예제 #1
0
 public void ReadFromXmlWithoutHrefThrows(
     string attribute,
     AtomLink seed,
     IContentSerializer dummySerializer)
 {
     XNamespace atom = "http://www.w3.org/2005/Atom";
     var xml = XDocument.Parse(seed.ToXmlString(dummySerializer));
     xml.Root.Attribute(attribute).Remove();
     using(var r = xml.CreateReader())
     {
         var e = Assert.Throws<ArgumentException>(
             () => AtomLink.ReadFrom(r));
         Assert.Contains(attribute, e.Message);
     }
 }
예제 #2
0
 public void SutCanRoundTripToString(
     AtomLink expected,
     IContentSerializer dummySerializer)
 {
     var xml = expected.ToXmlString(dummySerializer);
     AtomLink actual = AtomLink.Parse(xml);
     Assert.Equal(expected, actual);
 }
예제 #3
0
 public void ReadFromReturnsCorrectResult(
     AtomLink expected,
     IContentSerializer dummySerializer)
 {
     using (var sr = new StringReader(expected.ToXmlString(dummySerializer)))
     using (var r = XmlReader.Create(sr))
     {
         AtomLink actual = AtomLink.ReadFrom(r);
         Assert.Equal(expected, actual);
     }
 }