Пример #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);
        }
        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);
        }
        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();
 }