Beispiel #1
0
        public void when_creating_from_manually_created_exception_should_have_Message_copied()
        {
            var ex    = new InvalidOperationException("Invalid operation");
            var model = ExceptionModelBuilder.CreateFromException(ex);

            Assert.AreEqual("Invalid operation", model.Message);
        }
Beispiel #2
0
        public void when_creating_from_manually_created_exception_should_have_expected_Class()
        {
            var ex    = new InvalidOperationException("Invalid operation");
            var model = ExceptionModelBuilder.CreateFromException(ex);

            Assert.AreEqual(typeof(InvalidOperationException).Name, model.Class);
        }
Beispiel #3
0
        public void when_creating_from_manually_created_exception()
        {
            var ex    = new InvalidOperationException("Invalid operation");
            var model = ExceptionModelBuilder.CreateFromException(ex);

            it["should have expected Class"] = () => model.Class.should_be("InvalidOperationException");
            it["should have Message copied"] = () => model.Message.should_be("Invalid operation");
        }
Beispiel #4
0
        public void when_creating_from_thrown_exception_should_have_Message()
        {
            try
            {
                CreateException();
            }
            catch (Exception ex)
            {
                var model = ExceptionModelBuilder.CreateFromException(ex);

                Assert.IsNotNullOrEmpty(model.Message);
            }
        }
Beispiel #5
0
        public void when_creating_from_thrown_exception_should_have_expected_Class()
        {
            try
            {
                CreateException();
            }
            catch (Exception ex)
            {
                var model = ExceptionModelBuilder.CreateFromException(ex);

                Assert.AreEqual(typeof(DivideByZeroException).Name, model.Class);
            }
        }
Beispiel #6
0
        public void when_creating_from_thrown_exception()
        {
            try
            {
                CreateException();
            }
            catch (Exception ex)
            {
                var model = ExceptionModelBuilder.CreateFromException(ex);

                it["should have excepted Class"] = () => model.Class.should_be("DivideByZeroException");
                it["should have Message"]        = () => model.Message.should_not_be_empty();
            }
        }