public void Constructor_SetsProperties() { var n = new GravatarProfileName("Jon Doe", "Doe", "Jon", "Emmanuel", "NA", "N/A"); Assert.AreEqual("Jon Doe", n.Formatted); Assert.AreEqual("Doe", n.FamilyName); Assert.AreEqual("Jon", n.GivenName); Assert.AreEqual("Emmanuel", n.MiddleName); Assert.AreEqual("NA", n.HonorificPrefix); Assert.AreEqual("N/A", n.HonorificSuffix); }
public void Constructor_SetsProperties() { var n = new GravatarProfileName("Jon Doe", "Doe", "Jon", "Emmanuel", "NA", "N/A"); Assert.AreEqual("Jon Doe", n.Formatted); Assert.AreEqual("Doe", n.FamilyName); Assert.AreEqual("Jon", n.GivenName); Assert.AreEqual("Emmanuel", n.MiddleName); Assert.AreEqual("NA", n.HonorificPrefix); Assert.AreEqual("N/A", n.HonorificSuffix); }
public void Name_ComesFromParsedName() { var parser = new Mock<GravatarProfileParser>(MockBehavior.Strict); var name = new GravatarProfileName("", "", "", "", "", ""); var count = 0; parser.Setup(p => p.ParseName()).Returns(delegate { count++; return name; }); var info = new GravatarProfileInformation { Parser = parser.Object }; Assert.AreSame(name, info.Name); Assert.AreSame(name, info.Name); Assert.AreEqual(1, count); }
public void Name_ComesFromParsedName() { var parser = new Mock <GravatarProfileParser>(MockBehavior.Strict); var name = new GravatarProfileName("", "", "", "", "", ""); var count = 0; parser.Setup(p => p.ParseName()).Returns(delegate { count++; return(name); }); var info = new GravatarProfileInformation { Parser = parser.Object }; Assert.AreSame(name, info.Name); Assert.AreSame(name, info.Name); Assert.AreEqual(1, count); }
public void ToString_ReturnsFormatted() { var n = new GravatarProfileName("Jane Doe", null, null, null, null, null); Assert.AreEqual("Jane Doe", n.ToString()); }
public void ToString_ReturnsFormatted() { var n = new GravatarProfileName("Jane Doe", null, null, null, null, null); Assert.AreEqual("Jane Doe", n.ToString()); }