Esempio n. 1
0
        public void ValidationException_CreateAnObject()
        {
            // arrange
            string expected = "ValidationException";
            // act
            ValidationException ex = new ValidationException("Test Exception", "");

            //assert
            Assert.IsNotNull(ex);
            Assert.AreEqual(expected, ex.GetType().Name);
        }
Esempio n. 2
0
        protected virtual void informs <T>(string message) where T : Exception
        {
            informs(message);

            if (!(the_exception is T) && !(the_validation_exception is T))
            {
                "it".should_fail($"Exception was {(the_exception != null ? the_exception.GetType() : the_validation_exception.GetType())} but should have been {typeof(T)}.");
            }
        }