コード例 #1
0
        public void ResourceProvider_FolderExists_WorkWithTransposedEmbeddedResources()
        {
            var provider = new Core.Provider.ResourceProvider(new[] { typeof(Anchor).Assembly });

            provider.FolderExists("Content").Should().BeTrue();
            provider.FolderExists("Contet").Should().BeFalse();
        }
コード例 #2
0
        public void ResourceProvider_GetManifestResourceName_WorkWithEmbeddedResources()
        {
            var provider = new Core.Provider.ResourceProvider(new[] { typeof(Anchor).Assembly });

            provider.GetManifestResourceName(@"\folder\Class1.txt").Should().NotBeNullOrWhiteSpace();
            provider.GetManifestResourceName(@"folder/Class1.txt").Should().NotBeNullOrWhiteSpace();
            provider.GetManifestResourceName(@"/folder/Class1.txt").Should().NotBeNullOrWhiteSpace();
            provider.GetManifestResourceName(@"Class1.css").Should().NotBeNullOrWhiteSpace();
            provider.GetManifestResourceName(@"folder").Should().BeNullOrWhiteSpace();
        }
コード例 #3
0
        public void ResourceProvider_FileExists_WorkWithTransposedEmbeddedResources()
        {
            var provider = new Core.Provider.ResourceProvider(new[] { typeof(Anchor).Assembly });

            provider.FileExists(@"Content\Class1.txt").Should().BeTrue();
            provider.FileExists(@"\Content\Class1.txt").Should().BeTrue();
            provider.FileExists(@"Content/Class1.txt").Should().BeTrue();
            provider.FileExists(@"/Content/Class1.txt").Should().BeTrue();
            provider.FileExists(@"Scripts/Class1.js").Should().BeTrue();
            provider.FileExists(@"/Scripts/Class1.js").Should().BeTrue();
        }
コード例 #4
0
        public void ResourceProvider_FileExists_WorkWithEmbeddedResources()
        {
            var provider = new Core.Provider.ResourceProvider(new[] { typeof(Anchor).Assembly });

            provider.FileExists(@"folder\Class1.txt").Should().BeTrue();
            provider.FileExists(@"\folder\Class1.txt").Should().BeTrue();
            provider.FileExists(@"folder/Class1.txt").Should().BeTrue();
            provider.FileExists(@"/folder/Class1.txt").Should().BeTrue();
            provider.FileExists(@"folder.with.dots/Class1.js").Should().BeTrue();
            provider.FileExists(@"/folder.with.dots/Class1.js").Should().BeTrue();
            provider.FileExists(@"folder/with.dots/Class1.js").Should().BeFalse();
            provider.FileExists(@"/folder/with.dots/Class1.js").Should().BeFalse();
            provider.FileExists(@"Class1.css").Should().BeTrue();
            provider.FileExists(@"folder").Should().BeFalse();
        }
コード例 #5
0
        public void ResourceProvider_GetResourceFolder_WorkWithTransposedEmbeddedResources()
        {
            var provider = new Core.Provider.ResourceProvider(new[] { typeof(Anchor).Assembly });

            provider.GetResourceFolder("Content").Should().NotBeNull();
            provider.GetResourceFolder("Scripts").Should().NotBeNull();
        }
コード例 #6
0
        public void ResourceProvider_GetResourceFolder_WorkWithEmbeddedResources()
        {
            var provider = new Core.Provider.ResourceProvider(new[] { typeof(Anchor).Assembly });

            provider.GetResourceFolder("folder").Should().NotBeNull();
            provider.GetResourceFolder("flder").Should().BeNull();
        }
コード例 #7
0
        public void ResourceProvider_GetResourceFile_WorkWithTransposedEmbeddedResources()
        {
            var provider = new Core.Provider.ResourceProvider(new[] { typeof(Anchor).Assembly });

            provider.GetResourceFile(@"folder\Class1.txt").Should().Be(provider.GetResourceFile(@"Content\Class1.txt"));
            provider.GetResourceFile(@"\folder\Class1.txt").Should().Be(provider.GetResourceFile(@"\Content\Class1.txt"));
            provider.GetResourceFile(@"folder/Class1.txt").Should().Be(provider.GetResourceFile(@"Content/Class1.txt"));
            provider.GetResourceFile(@"/folder/Class1.txt").Should().Be(provider.GetResourceFile(@"/Content/Class1.txt"));
            provider.GetResourceFile(@"folder.with.dots/Class1.js").Should().Be(provider.GetResourceFile(@"Scripts/Class1.js"));
            provider.GetResourceFile(@"/folder.with.dots/Class1.js").Should().Be(provider.GetResourceFile(@"/Scripts/Class1.js"));
        }
コード例 #8
0
        public void ResourceProvider_GetResourceFile_WorkWithEmbeddedResources()
        {
            var provider = new Core.Provider.ResourceProvider(new[] { typeof(Anchor).Assembly });

            provider.GetResourceFile(@"folder\Class1.txt").Should().NotBeNull();
            provider.GetResourceFile(@"\folder\Class1.txt").Should().NotBeNull();
            provider.GetResourceFile(@"folder/Class1.txt").Should().NotBeNull();
            provider.GetResourceFile(@"/folder/Class1.txt").Should().NotBeNull();
            provider.GetResourceFile(@"folder.with.dots/Class1.js").Should().NotBeNull();
            provider.GetResourceFile(@"/folder.with.dots/Class1.js").Should().NotBeNull();
            provider.GetResourceFile(@"folder/with.dots/Class1.js").Should().BeNull();
            provider.GetResourceFile(@"/folder/with.dots/Class1.js").Should().BeNull();
            provider.GetResourceFile(@"Class1.css").Should().NotBeNull();
            provider.GetResourceFile(@"folder").Should().BeNull();
        }