public void Title() { var metadata = new MetadataInfo(); metadata.Add("Title", "Simple"); Assert.AreEqual("Simple", metadata.Title); }
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."); }
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."); }
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."); }
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."); }
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."); }