public void ShouldPopulatestatementModel()
        {
            var statement = new Statement(customer);

            repository.Add(statement);
            ViewResult result = controller.Show(0);

            Assert.That(result.Model, Is.SameAs(statement));
        }
        public RedirectResult Create()
        {
            var statement = new Statement(customer);
            int id        = repository.Add(statement);

            return(Redirect("/statements/" + id));
        }
Beispiel #3
0
        public void ShouldProvideStatementsForCustomer()
        {
            var repository = new StatementRepository();

            var c1 = new Customer("One");
            var c2 = new Customer("Two");

            var statement = new Statement(c1);

            repository.Add(statement);

            repository.Add(new Statement(c2));

            var c1statements = repository.FindByCustomer(c1);

            Assert.That(c1statements.Contains(statement));
            Assert.That(c1statements.Count(), Is.EqualTo(1));
        }
Beispiel #4
0
 public int AddStatement(StatementDTO data)
 {
     try
     {
         var A = new StatementRepository();
         return(A.Add(data));
     }
     catch (Exception e)
     {
         throw new FaultException <Exception>(e);
     }
 }
Beispiel #5
0
        public async Task <StatementDto> Deposit(StatementDepositDto dto)
        {
            ValidationHelper.Validate(_statementDepositValidator, dto);
            var account = await _accountRepository.GetByIBanNumber(dto.iban_number);

            var statement = new Statement
            {
                Account       = account,
                Amount        = dto.amount,
                CreateAt      = DateTime.Now,
                Fee           = _appSettings.DepositFee,
                StatementType = Application.Enums.StatementType.Deposit
            };
            await _statementRepository.Add(statement);

            return(ConvertToDto(statement));
        }