예제 #1
0
        public void Equals_Null_False()
        {
            // Arrange
            var testVm = new AccountViewModel();

            // Act
            var result = testVm.Equals(null);

            // result
            result.ShouldBeFalse();
        }
예제 #2
0
        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();
        }
예제 #3
0
        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();
        }
예제 #4
0
        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();
        }
예제 #5
0
 public void EqualsReturnsFalseOnNull(AccountViewModel vm1, AccountViewModel vm2, bool result)
 {
     // Act / Assert
     vm1.Equals(vm2).Should().Be(result);
 }