public async Task TestGetStockItemAsync() { // Arrange var dbContext = DbContextMocker.GetWideWorldImportersDbContext(nameof(TestGetStockItemAsync)); var controller = new WarehouseController(null, dbContext); var id = 1; // Act var response = await controller.GetStockItemAsync(id) as ObjectResult; var value = response.Value as ISingleResponse<StockItem>; dbContext.Dispose(); // Assert Assert.False(value.DidError); }
public async Task TestGetStockItemAsync() { // Arrange var repository = RepositoryMocker.GetWarehouseRepository(nameof(TestGetStockItemAsync)); var controller = new WarehouseController(null, repository); var id = 1; // Act var response = await controller.GetStockItemAsync(id) as ObjectResult; var value = response.Value as ISingleResponse <StockItem>; repository.Dispose(); // Assert Assert.False(value.DidError); }