public void SerializeWithExcludedProperties() { var model = new ExcludedPropertiesModel { CardFullName = "Blake Niemyjski", CardNumber = "4242 4242 4242 4242", CardLastFour = "4242", Expiration = new DateTime(2013, 1, 1), CardType = "Visa", UserName = "******", Password = "******", ConfirmPassword = "******", PasswordSalt = "5C365DCF-A426-4D8F-9662-2B62DC4FC4E3", HashCode = "0F3F5D30-DDE8-4086-8A77-632E85CF542E", ResetPasswordAfter90Days = true, RememberMe = true, SSN = "123-45-6789", SocialSecurityNumber = "123-45-6789", PhoneNumber = "123-456-7890", DateOfBirth = new DateTime(1986, 10, 16), EncryptedString = "82171AA4-43F7-47B4-B4E3-2BF6B1CF7F3C" }; string value = ModelSerializer.Current.SerializeToString(model, excludedPropertyNames: new List <string> { "*cardnumber*", "*password", "*ssn*", "*socialsecurity*", "EncryptedString" }); Assert.NotNull(value); Approvals.Verify(value); }
public void SerializeWithExcludedProperties() { var model = new ExcludedPropertiesModel { CardFullName = "Blake Niemyjski", CardNumber = "4242 4242 4242 4242", CardLastFour = "4242", Expiration = new DateTime(2013, 1, 1), CardType = "Visa", UserName = "******", Password = "******", ConfirmPassword = "******", PasswordSalt = "5C365DCF-A426-4D8F-9662-2B62DC4FC4E3", HashCode = "0F3F5D30-DDE8-4086-8A77-632E85CF542E", ResetPasswordAfter90Days = true, RememberMe = true, SSN = "123-45-6789", SocialSecurityNumber = "123-45-6789", PhoneNumber = "123-456-7890", DateOfBirth = new DateTime(1986, 10, 16), EncryptedString = "82171AA4-43F7-47B4-B4E3-2BF6B1CF7F3C" }; string value = ModelSerializer.Current.SerializeToString(model, excludedPropertyNames: new List<string> { "*cardnumber*", "*password", "*ssn*", "*socialsecurity*", "EncryptedString" }); Assert.NotNull(value); Approvals.Verify(value); }