コード例 #1
0
        public void adds_the_user_supplied_extensions()
        {
            var settings = new AssetSettings();
            var manifest = settings.CreateFileWatcherManifest(FubuApplicationFiles.ForDefault());

            manifest.AssetExtensions.ShouldContain(".svg");
            manifest.AssetExtensions.ShouldContain(".ttf");
            manifest.AssetExtensions.ShouldContain(".eot");
        }
コード例 #2
0
        public void no_public_folder_if_in_anywhere_mode()
        {
            var settings = new AssetSettings
            {
                Mode = SearchMode.Anywhere
            };

            settings.CreateFileWatcherManifest(FubuApplicationFiles.ForDefault()).PublicAssetFolder.ShouldBeEmpty();
        }
コード例 #3
0
        public void is_not_under_exploded_bottle_folder_negative()
        {
            new[] { FubuMvcPackageFacility.FubuContentFolder, FubuMvcPackageFacility.FubuPackagesFolder }.Each(folder =>
            {
                var directory         = "runtime/{0}/p1".ToFormat(folder);
                var fubuFile          = new FubuFile("{0}/a.txt".ToFormat(directory), "p1");
                fubuFile.RelativePath = fubuFile.Path.PathRelativeTo(directory);

                FubuApplicationFiles.IsNotUnderExplodedBottleFolder(fubuFile).ShouldBeFalse();
            });
        }
コード例 #4
0
        public void is_not_under_exploded_bottle_folder_positive()
        {
            new[] { "some/content", "custom/packages", "files" }.Each(folder =>
            {
                var directory         = "runtime/{0}".ToFormat(folder);
                var fubuFile          = new FubuFile("{0}/b.txt".ToFormat(directory), "app");
                fubuFile.RelativePath = fubuFile.Path.PathRelativeTo(directory);

                FubuApplicationFiles.IsNotUnderExplodedBottleFolder(fubuFile).ShouldBeTrue();
            });
        }
コード例 #5
0
        public void adds_all_the_default_asset_extensions()
        {
            var settings = new AssetSettings();
            var manifest = settings.CreateFileWatcherManifest(FubuApplicationFiles.ForDefault());

            manifest.AssetExtensions.ShouldContain(".js");
            manifest.AssetExtensions.ShouldContain(".css");
            manifest.AssetExtensions.ShouldContain(".jpeg");
            manifest.AssetExtensions.ShouldContain(".jpg");
            manifest.AssetExtensions.ShouldContain(".bmp");
        }
コード例 #6
0
        public void adds_content_extensions()
        {
            var settings = new AssetSettings();

            settings.ContentMatches.Add(".foo");

            var manifest = settings.CreateFileWatcherManifest(FubuApplicationFiles.ForDefault());

            manifest.ContentMatches.ShouldContain(".foo");
            manifest.ContentMatches.ShouldContain(".htm");
            manifest.ContentMatches.ShouldContain(".html");
        }
コード例 #7
0
        public void set_the_public_folder_if_in_that_mode()
        {
            var settings = new AssetSettings
            {
                Mode         = SearchMode.PublicFolderOnly,
                PublicFolder = "public"
            };

            var manifest = settings.CreateFileWatcherManifest(FubuApplicationFiles.ForDefault());

            manifest.PublicAssetFolder.ShouldBe(
                AppDomain.CurrentDomain.BaseDirectory.ParentDirectory().ParentDirectory().AppendPath("public").Replace('\\', '/'));
        }
コード例 #8
0
        public void determine_the_public_folder_with_a_non_null_but_nonexistent_version()
        {
            new FileSystem().CreateDirectory(
                PublicFolder.ToFullPath());

            var settings = new AssetSettings
            {
                Version = Guid.NewGuid().ToString()
            };

            settings.DeterminePublicFolder(FubuApplicationFiles.ForDefault())
            .ShouldBe(PublicFolder.ToFullPath());
        }
コード例 #9
0
        public void determine_the_public_folder_with_no_version()
        {
            new FileSystem().CreateDirectory(
                PublicFolder.ToFullPath());

            var settings = new AssetSettings
            {
                Version = null
            };

            settings.DeterminePublicFolder(FubuApplicationFiles.ForDefault())
            .ShouldBe(PublicFolder);
        }
コード例 #10
0
        public void ignores_excluded_folders()
        {
            var faf = new FubuApplicationFiles();

            ClassUnderTest.Search.AppendExclude("*A3.cshtml");
            ClassUnderTest.Search.AppendExclude("Templates/*.*");

            ClassUnderTest.Search.ExcludedFilesFor(faf.GetApplicationPath());
            ClassUnderTest.Search.IncludedFilesFor(faf.GetApplicationPath());

            var files = faf.FindFiles(ClassUnderTest.Search).ToArray();

            files.ShouldNotHave(f => f.Path.EndsWith("A3.cshtml"));
            files.ShouldNotHave(f => f.Path.EndsWith("A4.cshtml"));
        }
コード例 #11
0
        public void ignores_excluded_folders()
        {
            var faf = FubuApplicationFiles.ForDefault();

            ClassUnderTest.Search.AppendExclude("*A3.cshtml");
            ClassUnderTest.Search.AppendExclude("Templates/*.*");

            ClassUnderTest.Search.ExcludedFilesFor(faf.RootPath);
            ClassUnderTest.Search.IncludedFilesFor(faf.RootPath);

            var files = faf.FindFiles(ClassUnderTest.Search).ToArray();

            files.ShouldNotContain(f => f.Path.EndsWith("A3.cshtml"));
            files.ShouldNotContain(f => f.Path.EndsWith("A4.cshtml"));
        }
コード例 #12
0
        public void ignores_excluded_folders()
        {
            var faf = new FubuApplicationFiles(FubuRuntime.DefaultApplicationPath().AppendPath("Views", "Razor"));

            ClassUnderTest.Search.AppendExclude("*A3.cshtml");
            ClassUnderTest.Search.AppendExclude("Templates/*.*");

            var path = System.Reflection.Assembly.GetExecutingAssembly().Location;

            var ex  = ClassUnderTest.Search.ExcludedFilesFor(faf.RootPath);
            var inc = ClassUnderTest.Search.IncludedFilesFor(faf.RootPath);

            var files = faf.FindFiles(ClassUnderTest.Search);

            files.ShouldNotContain(f => f.Path.EndsWith("A3.cshtml"));
            files.ShouldNotContain(f => f.Path.EndsWith("A4.cshtml"));
        }
コード例 #13
0
        public void determine_the_public_folder_when_the_version_does_exist()
        {
            new FileSystem().CreateDirectory(
                PublicFolder.ToFullPath());
            var expectedPath = AppDomain.CurrentDomain.BaseDirectory
                               .ParentDirectory().ParentDirectory().AppendPath("public", "1.0.1").ToFullPath();

            new FileSystem().CreateDirectory(
                expectedPath);

            var settings = new AssetSettings
            {
                Version = "1.0.1"
            };

            settings.DeterminePublicFolder(FubuApplicationFiles.ForDefault())
            .ShouldBe(expectedPath);
        }
コード例 #14
0
 public void SetUp()
 {
     theFiles = new FubuApplicationFiles(AppDomain.CurrentDomain.BaseDirectory.ParentDirectory().ParentDirectory());
 }
        public void SetUp()
        {
            var files = new FubuApplicationFiles();

            theRepository = new FlatFileMembershipRepository(files);
        }
コード例 #16
0
ファイル: BehaviorGraph.cs プロジェクト: zzekikaya/fubumvc
 public static BehaviorGraph BuildFrom<T>(IPerfTimer timer = null) where T : FubuRegistry, new()
 {
     return BehaviorGraphBuilder.Build(new T(), timer ?? new PerfTimer(), new Assembly[0], new ActivationDiagnostics(), FubuApplicationFiles.ForDefault());
 }
コード例 #17
0
 public void SetUp()
 {
     theFiles = new FubuApplicationFiles();
 }
コード例 #18
0
ファイル: BehaviorGraph.cs プロジェクト: zzekikaya/fubumvc
        public static BehaviorGraph BuildFrom(Action<FubuRegistry> configure, IPerfTimer timer = null)
        {
            var registry = new FubuRegistry();
            configure(registry);

            return BehaviorGraphBuilder.Build(registry, timer ?? new PerfTimer(), new Assembly[0], new ActivationDiagnostics(), FubuApplicationFiles.ForDefault());
        }
コード例 #19
0
        public void do_not_use_the_excluded_views()
        {
            var registry = new FubuRegistry();

            registry.AlterSettings <ViewEngineSettings>(x => {
                x.AddFacility(new FakeViewEngine1());
                x.AddFacility(new FakeViewEngine2());

                x.ExcludeViews(v => v.Name().StartsWith("A"));
                x.ExcludeViews(v => v.Name().StartsWith("C"));
            });

            var graph = BehaviorGraph.BuildFrom(registry);
            var views = graph.Settings.Get <ViewEngineSettings>().BuildViewBag(graph, new ActivationDiagnostics(), FubuApplicationFiles.ForDefault());

            views.Result.OrderBy(x => x.Name()).Select(x => x.Name())
            .ShouldHaveTheSameElementsAs("B1", "B2", "B3", "B4", "B5", "B6");
        }