public void TestGetFiles(IDataServices fakeRepo) { // IAzureRepository fakeRepo = new BlockBlobRepository(new MockCloudBlobContainerServices()); string containerName = "root"; fakeRepo.ConfigureContainer(containerName); fakeRepo.CreateNewFolder("root", "poze"); fakeRepo.AddNewFile("root/poze", "ceva.jpg", new FileStreamMock(45)); fakeRepo.AddNewFile("root", "ceva.txt", new FileStreamMock(66)); fakeRepo.AddNewFile("root/poze/poze2", "ceva2.jpg", new FileStreamMock(5)); List <FileDto> list = fakeRepo.GetFiles(containerName); Assert.AreEqual(2, list.Count); List <string> expected = new List <string>(); expected.Add("ceva.jpg"); expected.Add("poze2"); list = fakeRepo.GetFiles(containerName + "/poze"); Assert.AreEqual(expected.Count, list.Count); for (int i = 0; i < list.Count; ++i) { Assert.AreEqual(list[i].name, expected[i]); } }
private void SettingsUserSuccesfullyLoggedIn(string email) { // TODO : ceva erori pe aici ? //AppUser user = UserManager.FindById(User.Identity.GetUserId()); emailToContainerRepository.AddEmail(email); dataServices.ConfigureContainer(email); //defaultPath = "/" + azureServices.GetContainerName(); }