public async Task PostProductAsync() { // Arrange var userInfo = IdentityMocker.GetWarehouseOperatorIdentity().GetUserInfo(); var service = ServiceMocker.GetWarehouseService(userInfo, nameof(PostProductAsync)); var controller = new WarehouseController(null, service); var request = new PostProductRequest { ProductName = "Test product", ProductCategoryID = 100, UnitPrice = 9.99m, Description = "unit tests" }; // Act var response = await controller.PostProductAsync(request) as ObjectResult; var value = response.Value as ISingleResponse <Product>; service.Dispose(); // Assert Assert.False(value.DidError); }