コード例 #1
0
        public void DefaultValues()
        {
            var sut = new TestCaseResult();

            Assert.AreEqual(Names.UnknownMethod, sut.TestMethod);
            Assert.AreEqual("", sut.Parameters);
            Assert.False(sut.StartTime.HasValue);
            Assert.AreEqual(TimeSpan.Zero, sut.Duration);
            Assert.AreEqual(TestResult.Unknown, sut.Result);

            Assert.AreNotEqual(0, sut.GetHashCode());
            Assert.AreNotEqual(1, sut.GetHashCode());
        }
コード例 #2
0
        public void Equality_Default()
        {
            var a = new TestCaseResult();
            var b = new TestCaseResult();

            Assert.AreEqual(a, b);
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }
コード例 #3
0
        public void Equality_DifferentMethod()
        {
            var a = new TestCaseResult
            {
                TestMethod = Names.Method("[T,P] [T,P].M()")
            };
            var b = new TestCaseResult();

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
コード例 #4
0
        public void Equality_DifferentResult()
        {
            var a = new TestCaseResult
            {
                Result = TestResult.Success
            };
            var b = new TestCaseResult();

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
コード例 #5
0
        public void Equality_DifferentDuration()
        {
            var a = new TestCaseResult
            {
                Duration = TimeSpan.FromSeconds(3)
            };
            var b = new TestCaseResult();

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
コード例 #6
0
        public void Equality_DifferentStartTime()
        {
            var a = new TestCaseResult
            {
                StartTime = _someDateTime
            };
            var b = new TestCaseResult();

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
コード例 #7
0
        public void Equality_DifferentParameters()
        {
            var a = new TestCaseResult
            {
                Parameters = "p"
            };
            var b = new TestCaseResult();

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
コード例 #8
0
        public void Equality_ReallyTheSame()
        {
            var a = new TestCaseResult
            {
                TestMethod = Names.Method("[T,P] [T,P].M()"),
                Parameters = "p",
                StartTime  = _someDateTime,
                Duration   = TimeSpan.FromSeconds(3),
                Result     = TestResult.Success
            };
            var b = new TestCaseResult
            {
                TestMethod = Names.Method("[T,P] [T,P].M()"),
                Parameters = "p",
                StartTime  = _someDateTime,
                Duration   = TimeSpan.FromSeconds(3),
                Result     = TestResult.Success
            };

            Assert.AreEqual(a, b);
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }