public async Task Controller_Should_Return_NULL_Given_a_Non_Existing_ProductId() { GetProductByIdController controller = new GetProductByIdController(this.getProductByIdService); var result = await controller.GetProduct(nonExistingId); Assert.IsNull(result.Value); }
public async Task Controller_Should_Return_a_Product() { GetProductByIdController controller = new GetProductByIdController(this.getProductByIdService); var result = await controller.GetProduct(existingId); Assert.IsNotNull(result.Value); Assert.That(result.Value, Is.InstanceOf <ProductDto>()); Assert.AreEqual(result.Value.ProductId, existingId); }