public void simple_add_exception_to_CriticalErrorCollector()
 {
     CriticalErrorCollector c = new CriticalErrorCollector();
     Assert.Throws<ArgumentNullException>( () => c.Add( null, "" ) );
     Assert.DoesNotThrow( () => c.Add( new Exception( "A" ), null ) );
     c.Add( new Exception( "B" ), "Comment" );
     
     var errors = c.ToArray();
     Assert.That( errors[0].ToString(), Is.EqualTo( " - A" ) );
     Assert.That( errors[1].ToString(), Is.EqualTo( "Comment - B" ) );
 }
Beispiel #2
0
        public void simple_add_exception_to_CriticalErrorCollector()
        {
            CriticalErrorCollector c = new CriticalErrorCollector();

            c.Invoking(sut => sut.Add(null, "")).Should().Throw <ArgumentNullException>();
            c.Add(new Exception("A"), null);
            c.Add(new Exception("B"), "Comment");

            var errors = c.ToArray();

            errors[0].ToString().Should().Be(" - A");
            errors[1].ToString().Should().Be("Comment - B");
        }
Beispiel #3
0
        public void simple_add_exception_to_CriticalErrorCollector()
        {
            CriticalErrorCollector c = new CriticalErrorCollector();

            Assert.Throws <ArgumentNullException>(() => c.Add(null, ""));
            Assert.DoesNotThrow(() => c.Add(new Exception("A"), null));
            c.Add(new Exception("B"), "Comment");

            var errors = c.ToArray();

            Assert.That(errors[0].ToString(), Is.EqualTo(" - A"));
            Assert.That(errors[1].ToString(), Is.EqualTo("Comment - B"));
        }