public async Task GetByIdAsync_ShouldSuccessfullyGet() { MapperInitializer.InitializeMapper(); var context = ApplicationDbContextInMemoryFactory.InitializeContext(); await this.SeedDataAsync(context); var firmService = new FirmService(context); await firmService.GetByIdAsync(1); var expectedResult = "FN 1"; var actualResult = await firmService.GetByIdAsync(1); Assert.True(expectedResult == actualResult.Name); }
public async Task GetByIdAsync_WithNonExistingId_ShouldThrowArgumentNullException() { MapperInitializer.InitializeMapper(); var context = ApplicationDbContextInMemoryFactory.InitializeContext(); await this.SeedDataAsync(context); var firmService = new FirmService(context); await Assert.ThrowsAsync <ArgumentNullException>(async() => { await firmService.GetByIdAsync(3); }); }