CassetteApplication CreateApplication(Action <BundleCollection> configure)
        {
            var settings = new CassetteSettings
            {
                CacheDirectory  = new IsolatedStorageDirectory(storage),
                SourceDirectory = new FileSystemDirectory(Path.GetFullPath("assets"))
            };
            var bundles = new BundleCollection(settings);

            configure(bundles);
            var application = new CassetteApplication(
                bundles,
                settings,
                new CassetteRouting(new VirtualDirectoryPrepender("/")),
                () => httpContext.Object,
                ""
                );

            application.InstallRoutes(routes);
            return(application);
        }
        CassetteApplication CreateApplication(Action <BundleCollection> configure, string sourceDirectory = "assets")
        {
            IBundleContainer bundleContainer = null;
            var settings = new CassetteSettings("")
            {
                CacheDirectory  = new IsolatedStorageDirectory(storage),
                SourceDirectory = new FileSystemDirectory(Path.GetFullPath(sourceDirectory)),
                UrlGenerator    = new CassetteRouting(new VirtualDirectoryPrepender("/"), () => bundleContainer)
            };
            var bundles = new BundleCollection(settings);

            configure(bundles);
            var application = new CassetteApplication(
                bundles,
                settings,
                new CassetteRouting(new VirtualDirectoryPrepender("/"), () => bundleContainer),
                () => httpContext.Object
                );

            bundleContainer = application.BundleContainer;

            application.InstallRoutes(routes);
            return(application);
        }