Esempio n. 1
0
        public void should_ignore_incorrect_codeRRContext()
        {
            var context = new ErrorReporterContext(this, new Exception());

            var sut    = new TempDataProvider();
            var result = sut.Collect(context);

            result.Should().BeNull();
        }
Esempio n. 2
0
        public void should_return_null_when_the_collection_is_empty()
        {
            var httpContext = Substitute.For <HttpContextBase>();
            var context     = new AspNetMvcContext(this, new Exception(), httpContext);

            context.TempData = new TempDataDictionary();

            var sut    = new TempDataProvider();
            var result = sut.Collect(context);

            result.Should().BeNull();
        }
Esempio n. 3
0
        public void should_include_included_items()
        {
            var httpContext = Substitute.For <HttpContextBase>();
            var context     = new AspNetMvcContext(this, new Exception(), httpContext);
            var tempData    = new TempDataDictionary {
                { "MyToken", "Value1" }, { "MyValue", 20 }
            };

            context.TempData = tempData;

            var sut    = new TempDataProvider();
            var result = sut.Collect(context);

            result.Property("MyToken").Should().Be("Value1");
            result.Property("MyValue").Should().Be("20");
        }