Пример #1
0
        public void TestBinaryContentFolder()
        {
            MediaFolderProvider repository = new MediaFolderProvider();

            var folderName = "Images";
            var folder     = new MediaFolder(contentRepository, folderName)
            {
                AllowedExtensions = new[] { ".jpg", ".png" }
            };

            repository.Add(folder);

            var all = repository.All(contentRepository);

            Assert.AreEqual(1, all.Count());

            var item = (MediaFolder)repository.Get(all.First());

            Assert.AreEqual(folder.Name, item.Name);
            Assert.AreEqual(folder.DisplayName, item.DisplayName);
            Assert.AreEqual(folder.Repository, item.Repository);
            Assert.AreEqual(folder.AllowedExtensions.Count(), item.AllowedExtensions.Count());

            //   repository.Remove(item);
        }
Пример #2
0
        public void Test_Get_Folder()
        {
            MediaFolder mediaFolder = new MediaFolder(repository, "Test_Get_Folder");

            mediaFolder.DisplayName = "Test get Folder";
            mediaFolder.UserId      = "admin";
            provider.Add(mediaFolder);

            var gotFolder = provider.Get(mediaFolder);

            Assert.IsNotNull(gotFolder);
            Assert.AreEqual(mediaFolder.DisplayName, gotFolder.DisplayName);
            Assert.AreEqual(mediaFolder.UserId, gotFolder.UserId);
        }
Пример #3
0
        public void TestBinaryContentFolder()
        {
            MediaFolderProvider repository = new MediaFolderProvider();

            var folderName = "Images";
            var folder = new MediaFolder(contentRepository, folderName) { AllowedExtensions = new[] { ".jpg", ".png" } };

            repository.Add(folder);

            var all = repository.All(contentRepository);

            Assert.AreEqual(1, all.Count());

            var item = (MediaFolder)repository.Get(all.First());

            Assert.AreEqual(folder.Name, item.Name);
            Assert.AreEqual(folder.DisplayName, item.DisplayName);
            Assert.AreEqual(folder.Repository, item.Repository);
            Assert.AreEqual(folder.AllowedExtensions.Count(), item.AllowedExtensions.Count());

             //   repository.Remove(item);
        }