Esempio n. 1
0
        public void TestEqualsWithSameResultReturnsTrue([Values] bool isNull)
        {
            TestResultForTest resultInstanceOne = new TestResultForTest();
            ITestResult       resultOne         = isNull ? null : resultInstanceOne;

            INUnitTestResult testOne = new NUnitTestResult(resultOne);

            Assert.IsTrue(testOne.Equals(resultOne));
            // ReSharper disable once EqualExpressionComparison
            Assert.IsTrue(testOne.Equals(testOne));
        }
Esempio n. 2
0
        public void TestEqualsWithNotSameResultReturnsFalse([Values] bool isNull)
        {
            TestResultForTest resultInstanceOne = new TestResultForTest();
            TestResultForTest resultInstanceTwo = new TestResultForTest();

            resultInstanceTwo.Name = "result-name";
            ITestResult resultOne   = isNull ? null : resultInstanceOne;
            ITestResult resultTwo   = isNull ? resultInstanceTwo : null;
            object      resultWrong = "string";

            INUnitTestResult testOne = new NUnitTestResult(resultOne);
            INUnitTestResult testTwo = new NUnitTestResult(resultTwo);

            Assert.IsFalse(testOne.Equals(resultTwo));
            Assert.IsFalse(testOne.Equals(testTwo));
            Assert.IsFalse(testOne.Equals(resultWrong));
        }