async Task <Result <OrderConfirmed> > Run(SetupData data) { var order = new Order { Id = 1, ItemId = 1, LendingUnitId = 2, RequestingMemberId = 1, RequestingUnitId = 3, Status = data.StartingStatus }; var unitId = data.MemberSide == OrderSide.Lending ? order.LendingUnitId : order.RequestingUnitId; var member = new Member(2, unitId, data.MemberPermissions); var item = new Item { Id = 1, Price = 100 }; var orderingService = new Mock <IOrderingService>(); orderingService.Setup(a => a.GetOrder(1)).ReturnsAsync(order); orderingService.Setup(a => a.GetMemberById(2)).ReturnsAsync(member); orderingService.Setup(a => a.UpdateOrder(It.IsAny <Order>())) .ReturnsAsync(new BaseGatewayResponse(true)); orderingService.Setup(a => a.GetItem(1)).ReturnsAsync(item); orderingService.Setup(a => a.TransterMoney(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <int>())) .ReturnsAsync(new BaseGatewayResponse(true)); var handler = new ConfirmHandler(orderingService.Object); var request = new ConfirmOrderRequest(1, 2); return(await handler.Handle(request)); }
public void ConfirmCall(object sender) { closeTimer.Stop(); Confirmed = true; Dismissed = true; ConfirmHandler?.Invoke(this, null); Close(); }
public void Show(int cost, ConfirmHandler callback) { CostLabel_.text = cost.ToString(); OnConfirm = callback; gameObject.SetActive(true); }