public void Equals_Null_False() { // Arrange var testVm = new AccountViewModel(); // Act var result = testVm.Equals(null); // result result.ShouldBeFalse(); }
public void Equals_SameObject_True() { // Arrange var testVm = new AccountViewModel(); // Act // ReSharper disable once EqualExpressionComparison : Just for this test. var result = testVm.Equals(testVm); // result result.ShouldBeTrue(); }
public void Equals_OtherType_False() { // Arrange var testVm = new AccountViewModel(); // Act // ReSharper disable once SuspiciousTypeConversion.Global : Just for this test. var result = testVm.Equals(new CategoryViewModel()); // result result.ShouldBeFalse(); }
public void Equals_SameId_True() { // Arrange var testVm = new AccountViewModel { Id = 99 }; var compareVm = new AccountViewModel { Id = 99 }; // Act // ReSharper disable once SuspiciousTypeConversion.Global just for this test. var result = testVm.Equals(compareVm); // result result.ShouldBeTrue(); }
public void EqualsReturnsFalseOnNull(AccountViewModel vm1, AccountViewModel vm2, bool result) { // Act / Assert vm1.Equals(vm2).Should().Be(result); }