示例#1
0
        public void Title()
        {
            var metadata = new MetadataInfo();

            metadata.Add("Title", "Simple");
            Assert.AreEqual("Simple", metadata.Title);
        }
示例#2
0
        public void Date()
        {
            var metadata = new MetadataInfo();

            metadata.Add("date", "2014-10-12");
            Assert.IsTrue(metadata.Date.HasValue, "Date is unexpected.");
            Assert.AreEqual(
                2014, metadata.Date.Value.Year, "Date.Year is unexpected.");
            Assert.AreEqual(
                10, metadata.Date.Value.Month, "Date.Month is unexpected.");
            Assert.AreEqual(
                12, metadata.Date.Value.Day, "Date.Day is unexpected.");
        }
示例#3
0
        public void SchemesSingleKeyValue()
        {
            var metadata = new MetadataInfo();

            metadata.Add("Bob", "gary");
            Assert.AreEqual(
                1, metadata.Schemes.Count, "Schemes.Count is unexpected.");
            Assert.AreEqual(
                1,
                metadata.Schemes["Bob"].Count,
                "Schemes[Bob].Count is unexpected.");
            Assert.AreEqual(
                "gary",
                metadata.Schemes["Bob"][0],
                "Schemes[Bob][0] is unexpected.");
        }
示例#4
0
        public void CopryightSingleYear()
        {
            var metadata = new MetadataInfo();

            metadata.Add("Copyright", "2014, Dylan Moonfire");
            Assert.AreEqual(
                1,
                metadata.CopyrightYears.Count,
                "CopyrightYears.Count is unexpected.");
            Assert.AreEqual(
                2014,
                metadata.CopyrightYears[0],
                "CopyrightYears[0] is unexpected.");
            Assert.AreEqual(
                "Dylan Moonfire",
                metadata.CopyrightHolder,
                "CopyrightHolder is unexpected.");
        }
示例#5
0
        public void SchemesCommaSeparated()
        {
            var metadata = new MetadataInfo();

            metadata.Add("Bob", "gary, steve");
            Assert.AreEqual(
                1, metadata.Schemes.Count, "Schemes.Count is unexpected.");
            Assert.AreEqual(
                2,
                metadata.Schemes["Bob"].Count,
                "Schemes[Bob].Count is unexpected.");
            Assert.AreEqual(
                "gary",
                metadata.Schemes["Bob"][0],
                "Schemes[Bob][0] is unexpected.");
            Assert.AreEqual(
                "steve",
                metadata.Schemes["Bob"][1],
                "Schemes[Bob][1] is unexpected.");
        }
示例#6
0
        public void SchemesSemicolonWithCommas()
        {
            var metadata = new MetadataInfo();

            metadata.Add("Bob", "gary; steve, larry");
            Assert.AreEqual(
                1, metadata.Schemes.Count, "Schemes.Count is unexpected.");
            Assert.AreEqual(
                2,
                metadata.Schemes["Bob"].Count,
                "Schemes[Bob].Count is unexpected.");
            Assert.AreEqual(
                "gary",
                metadata.Schemes["Bob"][0],
                "Schemes[Bob][0] is unexpected.");
            Assert.AreEqual(
                "steve, larry",
                metadata.Schemes["Bob"][1],
                "Schemes[Bob][1] is unexpected.");
        }