Example #1
0
            public void ComplexDtosAreNotEqual_AssertFails()
            {
                //Arrange
                var expected = new ComplexDto1 {Dto1 = new ExampleDto1 {DoubleValue = 1.0, IntValue = 10}};
                var actual = new ComplexDto1 {Dto1 = new ExampleDto1 {DoubleValue = 1.0, IntValue = 20}};

                //Act
                bool assertFailed = false;
                try
                {
                    DtoAssert.AreEqual(expected, actual);
                }
                catch (AssertFailedException)
                {
                    assertFailed = true;
                }

                //Assert
                Assert.IsTrue(assertFailed);
            }
Example #2
0
            public void ComplexDtosAreEqualExceptForExcludedField_AssertPasses()
            {
                //Arrange
                var expected = new ComplexDto1 { ExcludedField = "1" };
                var actual = new ComplexDto1 { ExcludedField = "2" };

                //Act
                DtoAssert.AreEqual(expected, actual);

                //Assert test passes
            }
Example #3
0
            public void ComplexDtosAreEqual_AssertPasses()
            {
                //Arrange
                var expected = new ComplexDto1 {Dto1 = new ExampleDto1 {DoubleValue = 1.0, IntValue = 10}};
                var actual = new ComplexDto1 {Dto1 = new ExampleDto1 {DoubleValue = 1.0, IntValue = 10}};

                //Act
                DtoAssert.AreEqual(expected, actual);

                //Assert test passes
            }