protected override void Context()
            {
                SetupUserAgentStringForRequest("Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)");
                _imageCache.Setup(s => s.Put(It.IsAny <Stream>(), It.IsAny <string>(), It.IsAny <SvgMagicOptions>())).Verifiable();

                _options = SvgMagicOptions.Parse(_queryString, new SvgMagicHandlerConfigurationSection());
            }
            protected override void Context()
            {
                _imageCache.Setup(s => s.Put(It.IsAny <Stream>(), It.IsAny <string>(), It.IsAny <SvgMagicOptions>())).Verifiable();

                _options = SvgMagicOptions.Parse(_queryString, new SvgMagicHandlerConfigurationSection());

                _handler.ResourceExistsFunc = s => false;
            }
            protected override void Context()
            {
                _imageCache.Setup(s => s.Put(It.IsAny <Stream>(), It.IsAny <string>(), It.IsAny <SvgMagicOptions>())).Verifiable();

                _options = SvgMagicOptions.Parse(_queryString, new SvgMagicHandlerConfigurationSection());

                _request.SetupGet(s => s.CurrentExecutionFilePathExtension).Returns(".aspx");
            }
            protected override void Context()
            {
                _imageCache.Setup(s => s.Put(It.IsAny <Stream>(), It.IsAny <string>(), It.IsAny <SvgMagicOptions>())).Verifiable();

                _queryString.Add("force", "true");
                _queryString.Add("format", "bmp");

                _options = SvgMagicOptions.Parse(_queryString, new SvgMagicHandlerConfigurationSection());
            }
        protected override void SharedContext()
        {
            _fileSystem = CreateDependency <IFileSystem>();

            _imageCache = new FileSystemImageCache(_fileSystem.Object);

            _queryString = new NameValueCollection();
            _options     = SvgMagicOptions.Parse(_queryString, new SvgMagicHandlerConfigurationSection());
        }
            protected override void Context()
            {
                _imageCache.Setup(s => s.Put(It.IsAny <Stream>(), It.IsAny <string>(), It.IsAny <SvgMagicOptions>())).Verifiable();

                _options = SvgMagicOptions.Parse(_queryString, new SvgMagicHandlerConfigurationSection());

                _browserCacheDate = DateTime.Now;
                _resourceDate     = _browserCacheDate.AddSeconds(-1);

                _headers.Add("If-Modified-Since", _browserCacheDate.ToString("R"));
                _handler.GetResourceUpdateDateTimeFunc = s => _resourceDate;
            }
            protected override void Context()
            {
                _browserCapMock = CreateDependency <HttpBrowserCapabilitiesBase>();

                _browserCapMock.SetupGet(s => s.Browser).Returns("Android");
                _browserCapMock.SetupGet(s => s.MajorVersion).Returns(4);
                _browserCapMock.SetupGet(s => s.MinorVersion).Returns(4);
                _request.SetupGet(s => s.Browser).Returns(_browserCapMock.Object);

                _imageCache.Setup(s => s.Put(It.IsAny <Stream>(), It.IsAny <string>(), It.IsAny <SvgMagicOptions>())).Verifiable();

                _options = SvgMagicOptions.Parse(_queryString, new SvgMagicHandlerConfigurationSection());
            }
            protected override void Context()
            {
                _queryString = new NameValueCollection()
                {
                    { "height", "100" },
                    { "width", "100" }
                };

                _options = SvgMagicOptions.Parse(_queryString, new SvgMagicHandlerConfigurationSection());

                _urlPath      = "images/myimage.svg";
                _cacheUrlPath = "images/myimage.svg/myimage.png";
            }
            protected override void Context()
            {
                _imageCache.Setup(s => s.Put(It.IsAny <Stream>(), It.IsAny <string>(), It.IsAny <SvgMagicOptions>())).Callback(
                    (Stream s, string path, SvgMagicOptions options) =>
                {
                    var bitmap = new Bitmap(s);
                    _size      = bitmap.Size;
                }).Verifiable();

                _queryString.Add("force", "true");
                _queryString.Add("format", "png");
                _queryString.Add("height", "1500");

                _options = SvgMagicOptions.Parse(_queryString, new SvgMagicHandlerConfigurationSection());
            }
            protected override void Context()
            {
                _request.SetupGet(s => s.CurrentExecutionFilePath).Returns("scotland.svg");
                _request.Setup(s => s.MapPath(It.IsAny <string>())).Returns("scotland.svg");

                _imageCache.Setup(s => s.Put(It.IsAny <Stream>(), It.IsAny <string>(), It.IsAny <SvgMagicOptions>())).Verifiable();

                _options = SvgMagicOptions.Parse(_queryString, new SvgMagicHandlerConfigurationSection());

                _imageCache.Setup(s => s.Get(It.IsAny <string>(), It.IsAny <SvgMagicOptions>()))
                .Returns(GetSampleImageStream());

                _imageCache.Setup(s => s.GetCacheItemModifiedDateTime(It.IsAny <string>(), It.IsAny <SvgMagicOptions>()))
                .Returns(DateTime.Now.AddDays(-1));

                _handler.NoSvgSupportFunc = (options, @base) => true;
            }
            protected override void Context()
            {
                _queryString = new NameValueCollection()
                {
                    { "height", "100" },
                    { "width", "100" }
                };

                _options = SvgMagicOptions.Parse(_queryString, new SvgMagicHandlerConfigurationSection());

                _existingUrlPath      = "images/myimage.svg";
                _existingCacheUrlPath = "images/myimage.svg/h100_w100_myimage.png";

                _fileSystem.Setup(s => s.Exists(_existingUrlPath)).Returns(true);
                _fileSystem.Setup(s => s.Exists(_existingCacheUrlPath)).Returns(true);
                _fileSystem.Setup(s => s.Open(It.Is <string>(u => u == _existingCacheUrlPath))).Returns(new MemoryStream()).Verifiable();
            }