示例#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);
        }