public async Task <IActionResult> PlaceOrder(Buyer Buyer) { try { // TODO: Add insert logic here await _service.PlaceOrderAsync(Buyer); return(RedirectToAction(nameof(AllBuyer))); } catch { return(View()); } }
public async Task Placeorder() { Buyer buyer = new Buyer() { Id = 1, FirstName = "ddd", LastName = "ddd", Email = "*****@*****.**", PhoneNumber = 123456779, Address = "Delhi" }; placeorderservices.Setup(repos => repos.PlaceOrderAsync(buyer)).ReturnsAsync(buyer); var placeorder = await _placeorderservices.PlaceOrderAsync(buyer); Assert.Equal(buyer, placeorder); }