File size: 1,839 Bytes
fab29d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using VersOne.Epub.Schema;

namespace VersOne.Epub.Test.Unit.Schema.Opf.Metadata
{
    public class EpubMetadataLinkRelationshipTests
    {
        [Fact(DisplayName = "Converting a string to EpubMetadataLinkRelationship list should succeed")]
        public void ParsePropertyListTest()
        {
            string stringValue = "alternate marc21xml-record mods-record onix-record record voicing xml-signature xmp-record test-unknown-property";
            List<EpubMetadataLinkRelationship> expectedRelationshipList = new()
            {
                EpubMetadataLinkRelationship.ALTERNATE,
                EpubMetadataLinkRelationship.MARC21XML_RECORD,
                EpubMetadataLinkRelationship.MODS_RECORD,
                EpubMetadataLinkRelationship.ONIX_RECORD,
                EpubMetadataLinkRelationship.RECORD,
                EpubMetadataLinkRelationship.VOICING,
                EpubMetadataLinkRelationship.XML_SIGNATURE,
                EpubMetadataLinkRelationship.XMP_RECORD,
                EpubMetadataLinkRelationship.UNKNOWN
            };
            List<EpubMetadataLinkRelationship> actualRelationshipList = EpubMetadataLinkRelationshipParser.ParseRelationshipList(stringValue);
            Assert.Equal(expectedRelationshipList, actualRelationshipList);
        }

        [Fact(DisplayName = "Converting an empty string to EpubMetadataLinkRelationship list should succeed")]
        public void ParsePropertyListFromEmptyStringTest()
        {
            string stringValue = "   ";
            List<EpubMetadataLinkRelationship> expectedRelationshipList = new();
            List<EpubMetadataLinkRelationship> actualRelationshipList = EpubMetadataLinkRelationshipParser.ParseRelationshipList(stringValue);
            Assert.Equal(expectedRelationshipList, actualRelationshipList);
        }
    }
}