Example #1
0
        public void Given_Files_When_NewFileIsAdded_Then_ShouldHaveOneFileInDatabase()
        {
            RunOnDatabase(context =>
            {
                // ARRANGE
                var filesRepository = new FilesRepository(context);

                var file         = CreateFile(context, "C:\\folder\\file1.txt", "/download/5jtj5gitj4jrfs");
                var fileInserted = filesRepository.InsertAsync(file).Result;
                // ACT
                var result = filesRepository.GetByIdAsync(fileInserted.Id);
                // ASSERT
                result.Should().NotBe(null);
            });
        }