Пример #1
0
        public void PresetOnlyQueryCollectionRequestParserCommandsWithoutMatchingPreset()
        {
            IDictionary <string, string> expected = new Dictionary <string, string>();

            HttpContext       context = CreateHttpContext("?preset=Preset2");
            CommandCollection actual  = new PresetOnlyQueryCollectionRequestParser(Options.Create(new PresetOnlyQueryCollectionRequestParserOptions
            {
                Presets = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase)
                {
                    { "Preset1", "width=400&height=200" }
                }
            })).ParseRequestCommands(context);

            Assert.Equal(expected, actual);
        }
Пример #2
0
        public void PresetOnlyQueryCollectionRequestParserExtractsCommandsWithOtherCasing()
        {
            IDictionary <string, string> expected = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase)
            {
                { "width", "400" },
                { "height", "200" }
            };

            HttpContext       context = CreateHttpContext("?PRESET=PRESET1");
            CommandCollection actual  = new PresetOnlyQueryCollectionRequestParser(Options.Create(new PresetOnlyQueryCollectionRequestParserOptions
            {
                Presets = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase)
                {
                    { "Preset1", "width=400&height=200" }
                }
            })).ParseRequestCommands(context);

            Assert.Equal(expected, actual);
        }