Esempio n. 1
0
 private void buttonSave_Click(object sender, EventArgs e)
 {
     dataGridViewSelections.Rows.Add(
         SaveCount.ToString("00"),
         Current.Material.IsSelected.Count(p => p.Value),
         Current.Material,
         new CommandSelectVertices(Current.Material, CopyDictionary(Current.Material.IsSelected))
         );
     SaveCount++;
 }
        public async Task PaymentIsBiggerThanNeededToPayLoan()
        {
            var loanId = new Guid();

            CreatePayment(100, loanId);

            var change = await _paymentService.FoundPayment(loanId, 200);

            change.Should().Be(100);
            SaveCount.Should().Be(1);
            Payments[0].Should().HavePaidAmount(100);
            Payments[0].IsPaid.Should().BeTrue();
        }
        public async Task PaymentPartiallyPaid()
        {
            var loanId = new Guid();

            CreatePayment(100, loanId);

            var change = await _paymentService.FoundPayment(loanId, 50);

            change.Should().Be(0);
            SaveCount.Should().Be(1);
            Payments[0].Should().HavePaidAmount(50);
            Payments[0].IsPaid.Should().BeFalse();
        }
        public async Task FoundPaymentWhenEqualAmountIsPaid()
        {
            var loanId = new Guid();

            CreatePayment(100, loanId);

            var change = await _paymentService.FoundPayment(loanId, 100);

            change.Should().Be(0);
            SaveCount.Should().Be(1);
            Payments.Should().HaveAllPaymentsPaid();
            Payments[0].Should().HavePaidAmount(100);
        }
        public async Task PaymentIsBiggerThanOneInstallmentCost()
        {
            var loanId = new Guid();

            CreatePayment(100, loanId);
            CreatePayment(100, loanId, 1);

            var change = await _paymentService.FoundPayment(loanId, 200);

            change.Should().Be(0);
            SaveCount.Should().Be(1);
            Payments.Should().HaveAllPaymentsPaid();
            Payments[0].PaidAmount.Should().Be(100);
            Payments[1].PaidAmount.Should().Be(100);
        }