예제 #1
0
        public void TestNameComesFromConstructor()
        {
            const string name = "mytest";
            var sut = new SuccessResult(name);

            Assert.AreEqual(name, sut.TestName);
        }
예제 #2
0
        public void PassedIsTrueNullWhenNoFailureOrPending()
        {
            var success1 = new SuccessResult("good");
            var success2 = new SuccessResult("good");
            var success3 = new SuccessResult("good");

            var sut = new ResultCollection();
            sut.Add(success1);
            sut.Add(success2);
            sut.Add(success3);

            Assert.IsTrue(sut.Passed.Value);
        }
예제 #3
0
        public void PassedIsFalseWhenAnyFailureResultsExists()
        {
            var success = new SuccessResult("good");
            var pending = new PendingResult("pending");
            var failure = new FailureResult("bad", new Exception("djsfdsf"));

            var sut = new ResultCollection();
            sut.Add(success);
            sut.Add(pending);
            sut.Add(failure);

            Assert.IsFalse(sut.Passed.Value);
        }
예제 #4
0
        public void PassedIsFalsNullWhenPendingResultExistsWithNoFailures()
        {
            var success1 = new SuccessResult("good");
            var success2 = new SuccessResult("good");
            var success3 = new SuccessResult("good");
            var pending = new PendingResult("pending");

            var sut = new ResultCollection();
            sut.Add(success1);
            sut.Add(success2);
            sut.Add(pending);
            sut.Add(success3);

            Assert.IsNull(sut.Passed);
        }
예제 #5
0
        public void WasSuccessfuIsTrue()
        {
            var sut = new SuccessResult("mytest");

            Assert.IsTrue(sut.WasSuccess.Value);
        }
예제 #6
0
        public void MessageIsPassed()
        {
            var sut = new SuccessResult("mytest");

            Assert.AreEqual("Passed", sut.Message);
        }
예제 #7
0
        public void DetailedMessageIsEmpty()
        {
            var sut = new SuccessResult("mytest");

            Assert.AreEqual(string.Empty, sut.DetailedMessage);
        }