public void FillDataFrom_PartiallyEmptyProfileGivenFullProfile_ShouldOverwriteEmptyProperties() { const string existingEmail = "*****@*****.**"; const string existingName = "Hans"; const string existingOrganization = "Institut"; const string existingTitle = "Walker"; const string existingCountry = "Denmark"; const string email = "*****@*****.**"; const string title = "Weep"; var existingProfile = new Profile(existingEmail, existingName, existingOrganization, existingTitle, existingCountry); var fillingProfile = new Profile(email, null, "", title, " "); existingProfile.FillDataFrom(fillingProfile); Assert.AreEqual(email, existingProfile.Email); Assert.AreEqual(existingName, existingProfile.Name); Assert.AreEqual(existingOrganization, existingProfile.Organization); Assert.AreEqual(title, existingProfile.Title); Assert.AreEqual(existingCountry, existingProfile.Country); }
public void FillDataFrom_HasEmptyEmail_ShouldNotFillInEmail() { const string existingEmail = "*****@*****.**"; const string existingName = "Hans"; const string existingOrganization = "Institut"; const string existingTitle = "Walker"; const string existingCountry = "Denmark"; const string email = ""; const string name = "Peter"; const string organization = "Skolen"; const string title = "Runner"; const string country = "Sverige"; var existingProfile = new Profile(existingEmail, existingName, existingOrganization, existingTitle, existingCountry); var fillingProfile = new Profile(email, name, organization, title, country); existingProfile.FillDataFrom(fillingProfile); Assert.AreEqual(existingEmail, existingProfile.Email); Assert.AreEqual(name, existingProfile.Name); Assert.AreEqual(organization, existingProfile.Organization); Assert.AreEqual(title, existingProfile.Title); Assert.AreEqual(country, existingProfile.Country); }
public void FillDataFrom_EmptyProfileGivenFullProfile_ShouldOverwriteEverything() { const string email = "*****@*****.**"; const string name = "Peter"; const string organization = "Institut"; const string title = "Walker"; const string country = "Denmark"; var existingProfile = new Profile("", "", null, null, null); var fillingProfile = new Profile(email, name, organization, title, country); existingProfile.FillDataFrom(fillingProfile); Assert.AreEqual(email, existingProfile.Email); Assert.AreEqual(name, existingProfile.Name); Assert.AreEqual(organization, existingProfile.Organization); Assert.AreEqual(title, existingProfile.Title); Assert.AreEqual(country, existingProfile.Country); }