public async Task GetNotesByInvoice_WhenNotPresent_ReturnsNull(Func <string, InvoicingContext> factory) { //Arrange using (var context = factory(nameof(GetNotesByInvoice_WhenNotPresent_ReturnsNull))) { var sut = new InvoicesRepository(context); //Act var notes = await sut.GetNotesBy(100); //Assert notes.Should().BeNull(); } }
public async Task GetNotesByInvoiceId_WhenExists_ReturnsNotes(Func <string, InvoicingContext> factory) { //Arrange using (var context = factory(nameof(GetNotesByInvoiceId_WhenExists_ReturnsNotes))) { var invoiceId = 1; var sut = new InvoicesRepository(context); //Act var notes = await sut.GetNotesBy(invoiceId); //Assert notes.Should().NotBeNullOrEmpty(); } }
public async Task GetNotesByInvoice_WhenInvoiceExistsButHasNoNotes_ReturnsEmpty(Func <string, InvoicingContext> factory) { //Arrange using (var context = factory(nameof(GetNotesByInvoice_WhenInvoiceExistsButHasNoNotes_ReturnsEmpty))) { var sut = new InvoicesRepository(context); //Act var notes = await sut.GetNotesBy(2); //Assert notes.Should().NotBeNull(); notes.Should().BeEmpty(); } }