コード例 #1
0
        public void ResolvingStaticRoutesHandling()
        {
            RouteTable.Routes.Clear();
            IWindsorContainer container = new WindsorContainer();

            InitializeWindsor(ref container);
            AssemblyResourceProvider provider = new AssemblyResourceProvider();
            string path = @"Data\Avatars\default.png";
            string fp   = Assembly.GetExecutingAssembly().CodeBase;

            fp = Path.GetDirectoryName(path);
            fp = Path.GetDirectoryName(path);
            fp = Path.GetDirectoryName(path);
            fp = Path.Combine(fp, path);
            try
            {
                if (provider.FileExists("/data/Avatar/default.png"))
                {
                    provider.GetFile("/data/Avatar/default.png");
                }
            }
            catch
            {
                Assert.Pass();
            }
            Assert.Fail();
        }
コード例 #2
0
        public void File_exists()
        {
            //arrange
            var provider = new AssemblyResourceProvider();

            //act
            var result = provider.FileExists("~/foo");

            //assert
            Assert.IsFalse(result);
        }
コード例 #3
0
        public void FilesInClientResourcesFolder_ShouldExist(string path)
        {
            // Arrange
            var provider = new AssemblyResourceProvider();

            // Act
            var result = provider.FileExists("~/EPiServer/Geta.Epi.FontThumbnail/ClientResources" + path);

            // Assert
            Assert.True(result);
        }
コード例 #4
0
        public void FilesNotInClientResourcesFolder_ShouldNotExist(string path)
        {
            // Arrange
            var provider = new AssemblyResourceProvider();

            // Act
            var result = provider.FileExists(path);

            // Assert
            Assert.False(result);
        }
コード例 #5
0
 public bool FileExists(string virtualPath)
 {
     return(_assemblyResourceProvider.FileExists(virtualPath));
 }
コード例 #6
0
 public void ResolvingStaticRoutesHandling()
 {
     RouteTable.Routes.Clear();
     IWindsorContainer container = new WindsorContainer();
     InitializeWindsor(ref container);
     AssemblyResourceProvider provider = new AssemblyResourceProvider();
     string path = @"Data\Avatars\default.png";
     string fp = Assembly.GetExecutingAssembly().CodeBase;
     fp = Path.GetDirectoryName(path);
     fp = Path.GetDirectoryName(path);
     fp = Path.GetDirectoryName(path);
     fp = Path.Combine(fp, path);
     try
     {
         if (provider.FileExists("/data/Avatar/default.png"))
         {
             provider.GetFile("/data/Avatar/default.png");
         }
     }
     catch
     {
         Assert.Pass();
     }
     Assert.Fail();
 }