示例#1
0
        public void SetUp()
        {
            dictionary = new Dictionary<string, object>();
            aggregate = new AggregateDictionary();
            aggregate.AddDictionary(dictionary);

            request = new RequestData(aggregate);
        }
示例#2
0
        public void SetUp()
        {
            dictionary = new Dictionary <string, object>();
            aggregate  = new AggregateDictionary();
            aggregate.AddDictionary(dictionary);


            request = new RequestData(aggregate);
        }
示例#3
0
        public void SetUp()
        {
            theBinder = StandardModelBinder.Basic().As <StandardModelBinder>();

            theAggregateDictionary = new AggregateDictionary();

            var otherDictionary = new Dictionary <string, object>();

            for (int i = 0; i < 10; i++)
            {
                otherDictionary.Add("Part" + i, Guid.NewGuid().ToString());
            }

            theAggregateDictionary.AddDictionary(RequestDataSource.Request.ToString(), otherDictionary);


            theRouteValues = new Dictionary <string, object>();

            theAggregateDictionary.AddDictionary(RequestDataSource.Route.ToString(), theRouteValues);
        }
        public void SetUp()
        {
            var container = StructureMapContainerFacility.GetBasicFubuContainer();

            theHeaderDictionary = new Dictionary <string, object>();
            var dictionary = new AggregateDictionary();

            dictionary.AddDictionary(RequestDataSource.Header.ToString(), theHeaderDictionary);

            container.Inject(dictionary);

            theHeaders = container.GetInstance <RequestHeaders>();
        }
示例#5
0
        public void value_from_a_specific_locator()
        {
            var dictionary = new AggregateDictionary();

            dictionary.AddDictionary("Headers", new Dictionary <string, object> {
                { "key1", 1 },
                { "key2", 2 },
                { "key3", 3 },
                { "key4", 4 },
            });

            dictionary.AddDictionary("Post", new Dictionary <string, object> {
                { "key1", 11 },
                { "key2", 22 },
                { "key3", 33 },
                { "key4", 44 },
            });

            dictionary.AddDictionary("Querystring", new Dictionary <string, object> {
                { "key1", 111 },
                { "key2", 222 },
                { "key3", 333 },
                { "key4", 444 },
            });

            object lastNumber = null;
            Action <string, object> callback = (s, o) => lastNumber = o;

            dictionary.Value("Headers", "key2", callback);
            lastNumber.ShouldEqual(2);

            dictionary.Value("Post", "key2", callback);
            lastNumber.ShouldEqual(22);

            dictionary.Value("Querystring", "key2", callback);
            lastNumber.ShouldEqual(222);
        }
示例#6
0
        public void find_value_from_request_property_of_added_aggregate()
        {
            const string expectedValue = "STUBBED USERAGENT";

            aggregate = new AggregateDictionary();

            aggregate.AddDictionary("Other", new Dictionary <string, object> {
                { "UserAgent", expectedValue }
            });
            forKey("UserAgent1");
            callback.AssertWasNotCalled(x => x.Callback(RequestDataSource.Other.ToString(), null), o => o.IgnoreArguments());

            forKey("UserAgent");
            assertFound(RequestDataSource.Other, expectedValue);
        }
        public void SetUp()
        {
            theServiceArguments = new ServiceArguments();
            theDictionary       = new AggregateDictionary();
            theHeaders          = new Dictionary <string, object>();
            theDictionary.AddDictionary(RequestDataSource.Header.ToString(), theHeaders);

            theServiceArguments.Set(typeof(AggregateDictionary), theDictionary);

            stash <IHttpWriter>();
            stash <ICurrentChain>();

            theCache = new EtagCache();

            theFilter = new AssetEtagInvocationFilter(theCache);
        }