Пример #1
0
        public void should_add_file_and_delete()
        {
            var id = Guid.NewGuid().ToString();

            var repository = new MongoPolicy();
            var result     = repository.Add(file, id);

            Assert.IsTrue(repository.Exist(id));

            repository.Delete(result.fileName);
            Assert.IsFalse(repository.Exist(id));
        }
Пример #2
0
 public override void RemoveOutput(UploadedFile file)
 {
     //MongoPolicy.Delete(file.ServerLocation);
     // If it's a valid upload
     if (!string.IsNullOrEmpty(file.ServerLocation) && MongoPolicy.Exist(file.ServerLocation))
     {
         MongoPolicy.Delete(file.ServerLocation);
     }
 }