public void DeveRetornarListaVazia() { using (var context = new FileDbContext(GetDbContextOptions())) { context.Database.EnsureDeleted(); context.Database.EnsureCreated(); var fileS3Repository = new FileS3Repository(context); var fileS3Result = fileS3Repository.GetAll(); Assert.NotNull(fileS3Result); Assert.Equal(0, fileS3Result.Count); } }
public void DeveRetornarTodosRegistros() { using (var context = new FileDbContext(GetDbContextOptions())) { context.Database.EnsureDeleted(); context.Database.EnsureCreated(); var fileS3Repository = new FileS3Repository(context); List <FileS3> files = new List <FileS3>(); files.Add(fileS3Repository.Add(GetNewRandomFileS3())); files.Add(fileS3Repository.Add(GetNewRandomFileS3())); files.Add(fileS3Repository.Add(GetNewRandomFileS3())); var fileS3Result = fileS3Repository.GetAll(); Assert.NotNull(fileS3Result); Assert.Equal(files.Count, fileS3Result.Count); } }