Example #1
0
 public void Given_File_When_DeleteFileAsync_Then_ShouldBeTrue()
 {
     RunOnDatabase(context =>
     {
         // ARRANGE
         var filesRepository = new FilesRepository(context);
         var file            = CreateFile(context, "C:\\folder\\file1.txt", "/download/5jtj5gitj4jrfs");
         context.Files.Add(file);
         context.SaveChanges();
         // ACT
         var result = filesRepository.DeleteAsync(file.Id);
         // ASSERT
         result.Result.Should().Be(true);
     });
 }