public async Task RequestsCorrectUrl() { var connection = Substitute.For <IApiConnection>(); var client = new ProductsClient(connection); await client.Get(123); Received.InOrder(async() => { await connection.Get <Product>(Arg.Is <Uri>(u => u.ToString() == "products/123")); }); }
public async Task <ActionResult> Delete(int id) { ProductsClient api = new ProductsClient(); Product product = api.Get(id); if (product == null) { return(HttpNotFound()); } return(View(product)); }