public void UseIsolatedStorageWhenCachedDirectoryNotConfigured()
 {
     var section = new CassetteConfigurationSection();
     var configuration = new TestableWebHostSettingsConfiguration("/", section);
     var settings = new CassetteSettings();
     configuration.Configure(settings);
     settings.CacheDirectory.ShouldBeType<IsolatedStorageDirectory>();
 }
        public void UseIsolatedStorageWhenCachedDirectoryNotConfigured()
        {
            var section       = new CassetteConfigurationSection();
            var configuration = new TestableWebHostSettingsConfiguration("/", section);
            var settings      = new CassetteSettings();

            configuration.Configure(settings);
            settings.CacheDirectory.ShouldBeType <IsolatedStorageDirectory>();
        }
 public void UseFileSystemDirectoryWhenCacheDirectoryIsConfigured()
 {
     var section = new CassetteConfigurationSection
     {
         CacheDirectory = Environment.CurrentDirectory
     };
     var configuration = new TestableWebHostSettingsConfiguration("/", section);
     var settings = new CassetteSettings();
     configuration.Configure(settings);
     settings.CacheDirectory.ShouldBeType<FileSystemDirectory>();
 }
        public void UseFileSystemDirectoryWhenCacheDirectoryIsConfigured()
        {
            var section = new CassetteConfigurationSection
            {
                CacheDirectory = Environment.CurrentDirectory
            };
            var configuration = new TestableWebHostSettingsConfiguration("/", section);
            var settings      = new CassetteSettings();

            configuration.Configure(settings);
            settings.CacheDirectory.ShouldBeType <FileSystemDirectory>();
        }
        public void UseAbsoluteFileSystemDirectoryWhenCacheDirectoryIsConfiguredAsRelativePath()
        {
            var section = new CassetteConfigurationSection
            {
                CacheDirectory = "test"
            };
            var configuration = new TestableWebHostSettingsConfiguration("/", section);
            var settings = new CassetteSettings();
            configuration.Configure(settings);

            var directory = settings.CacheDirectory.ShouldBeType<FileSystemDirectory>();
            directory.FullSystemPath.ShouldEqual(Path.Combine(Environment.CurrentDirectory, "test").Replace('\\', '/'));
        }
        public void UseAbsoluteFileSystemDirectoryWhenCacheDirectoryIsConfiguredAsRelativePath()
        {
            var section = new CassetteConfigurationSection
            {
                CacheDirectory = "test"
            };
            var configuration = new TestableWebHostSettingsConfiguration("/", section);
            var settings      = new CassetteSettings();

            configuration.Configure(settings);

            var directory = settings.CacheDirectory.ShouldBeType <FileSystemDirectory>();

            directory.FullSystemPath.ShouldEqual(Path.Combine(Environment.CurrentDirectory, "test").Replace('\\', '/'));
        }