Пример #1
0
        public void EmptyListReturnsNoError()
        {
            var resolver = Mock.Of <EntryPointResolver>();

            Assert.That(PmlError.FromList(null, resolver), Is.Null);
            Assert.That(PmlError.FromList(new List <string>(), resolver), Is.Null);
        }
Пример #2
0
        public void EmptyHashTableReturnsNoError()
        {
            var resolver = Mock.Of <EntryPointResolver>();

            Assert.That(PmlError.FromHashTable(null, resolver), Is.Null);
            Assert.That(PmlError.FromHashTable(new Hashtable(), resolver), Is.Null);
        }
Пример #3
0
        public void ParseFromHashTable()
        {
            var message = Lines[0];
            var error   = PmlError.FromHashTable(ToHashTable(Lines), Resolver);

            Assert.That(error.Message, Is.EqualTo(message));
            Assert.That(error.StackTrace, Is.EquivalentTo(ExpectedStackTrace));

            message = MissingStackTrace[0];
            error   = PmlError.FromHashTable(ToHashTable(MissingStackTrace), Resolver);
            Assert.That(error.Message, Is.EqualTo(message));
            Assert.That(error.StackTrace, Is.Empty);
        }
Пример #4
0
        public void SetsErrorMessageLabelText()
        {
            var error = new PmlError("This is a test");

            TestDetails.Test.Result = new TestResult(TimeSpan.FromSeconds(0), error);
            Assert.AreEqual(error.Message, ErrorMessageLabel.Text);

            TestDetails.Test.Result = new TestResult(TimeSpan.FromSeconds(0));
            Assert.AreEqual("", ErrorMessageLabel.Text);

            TestDetails.Test.Result = new TestResult(TimeSpan.FromSeconds(0), error);
            Assert.AreEqual(error.Message, ErrorMessageLabel.Text);

            TestDetails.Test.Result = null;
            Assert.AreEqual("", ErrorMessageLabel.Text);
        }