public void Constructor_ShouldParseOutFromToXmlString() { const string email = "*****@*****.**"; const string name = "Peter"; const string organization = "Institut"; const string title = "Walker"; const string country = "Denmark"; var profile1 = new Profile(email, name, organization, title, country); var profile2 = new Profile(XDocument.Parse(profile1.ToXmlString())); Assert.AreEqual(email, profile2.Email); Assert.AreEqual(name, profile2.Name); Assert.AreEqual(organization, profile2.Organization); Assert.AreEqual(title, profile2.Title); Assert.AreEqual(country, profile2.Country); }
public void ToXmlString_ShouldCorrectXml() { const string email = "*****@*****.**"; const string name = "Peter"; const string organization = "Institut"; const string title = "Walker"; const string country = "Denmark"; var profile = new Profile(email, name, organization, title, country); var xmlString = profile.ToXmlString(); Assert.That(xmlString, Is.EqualTo("<CHAOS.Profile><Name>Peter</Name><Title>Walker</Title><About></About><Organization>Institut</Organization><Emails><Email>[email protected]</Email></Emails><Phonenumbers><Phonenumber></Phonenumber></Phonenumbers><Websites><Website></Website></Websites><Skype></Skype><LinkedIn></LinkedIn><Twitter></Twitter><Address></Address><City></City><ZipCode></ZipCode><Country>Denmark</Country></CHAOS.Profile>")); }