Exemplo n.º 1
0
        public void Should_include_both_name_and_extensions_in_message()
        {
            var result = new ViewNotFoundException("foo", new[] { "html", "sshtml" });

            result.Message.ShouldContain("foo");
            result.Message.ShouldContain("html");
            result.Message.ShouldContain("sshtml");
        }
        public void Should_include_both_name_and_extensions_in_message()
        {
            // Given
            var rootPathProvider = A.Fake <IRootPathProvider>();

            A.CallTo(() => rootPathProvider.GetRootPath()).Returns("The root path");

            // When
            var result = new ViewNotFoundException("foo", new[] { "html", "sshtml" }, new[] { "baz", "bar" }, rootPathProvider);

            // Then
            result.Message.ShouldContain("foo");
            result.Message.ShouldContain("html");
            result.Message.ShouldContain("sshtml");
            result.Message.ShouldContain("baz");
            result.Message.ShouldContain("bar");
        }
Exemplo n.º 3
0
        public void HttpStatusCodeIsPopulated()
        {
            var ex = new ViewNotFoundException("sch", "vw");

            Assert.AreEqual(HttpStatusCode.InternalServerError, ex.ResponseCode);
        }
Exemplo n.º 4
0
        public void HttpErrorMessageIsPopulated()
        {
            var ex = new ViewNotFoundException("sch", "vw");

            Assert.AreEqual("ViewNotFound", ex.HttpErrorMessage);
        }
Exemplo n.º 5
0
        public void ErrorMessageIsPopulated()
        {
            var ex = new ViewNotFoundException("sch", "vw");

            Assert.AreEqual("View 'sch.vw' not found.", ex.Message);
        }
Exemplo n.º 6
0
        public void IsBaseException()
        {
            var ex = new ViewNotFoundException("a", "b");

            Assert.IsInstanceOfType(ex, typeof(BaseCaughtException));
        }