/// <summary> /// 出库 /// </summary> /// <param name="customId"></param> public void CheckOutWare(int customId) { ShowCustomList = false; UserContext.RfidReadProvider.OnDataReceived += RfidReadProvider_OnDataReceived; SelectedCustom = CustomSource.FirstOrDefault(_ => _.Id == customId); WareOutDetailSource = new ObservableCollection <WareOutDetailVM>(); WareOutDetailTypeSource = new ObservableCollection <WareOutDetailType>(); var custom = _customs.Find(_ => _.Id == customId); if (custom == null) { return; } int index = 1; foreach (var wareInfo in custom.WareInfos) { WareOutDetailSource.Add(new WareOutDetailVM() { Index = index++, WareTypeId = wareInfo.WareTypeId, WareTypeName = wareInfo.WareTypeName, Capacity = wareInfo.Capacity, Stock = wareInfo.Stock, MaxCount = wareInfo.Capacity - wareInfo.Stock }); } }
private async Task ShouldRequestPayment_CustomSource() { CustomSource customSource = new CustomSource { amount = 10L, currency = Currency.USD }; var paymentRequest = new PaymentRequest(); paymentRequest.Source = customSource; var paymentResponse = new PaymentResponse(); _apiClient.Setup(apiClient => apiClient.Post <PaymentResponse>(PaymentsPath, _authorization, paymentRequest, CancellationToken.None, null)) .ReturnsAsync(() => paymentResponse); IPaymentsClient paymentsClient = new PaymentsClient(_apiClient.Object, _configuration.Object); var response = await paymentsClient.RequestPayment(paymentRequest, null, CancellationToken.None); response.ShouldNotBeNull(); response.ShouldBeSameAs(paymentResponse); }