Exemplo n.º 1
0
        public void GetAllCustomers_should_return_expected_result(int expectedId)
        {
            _serviceCustomer.Insert(new Customer {
                Id = expectedId, Name = "mehmet", Surname = "yildiz"
            });
            _serviceCustomer.Insert(new Customer {
                Id = 1, Name = "nurgul", Surname = "dereli"
            });

            //when
            var result = _serviceCustomer.GetAll();

            //then
            result.Data.First().Id.Should().Be(expectedId);
            result.Data.Count().Should().Be(2);
        }
Exemplo n.º 2
0
        public void GetAllAccounts_should_return_expected_result(int newId)
        {
            _serviceAccount.Insert(new Account {
                Id = newId, Balance = 100, CustomerId = 1, InitialCredit = 50
            });
            _serviceAccount.Insert(new Account {
                Id = 1, Balance = 50, CustomerId = 3, InitialCredit = 500
            });

            //when
            var result = _serviceAccount.GetAll();

            //then
            result.Data.Any(x => x.Id == newId).Should().BeTrue();
            result.Data.Count().Should().BeGreaterOrEqualTo(2);
        }
Exemplo n.º 3
0
        public void GetAllTransactions_should_return_expected_result(int newId)
        {
            _serviceTransaction.Insert(new Transaction {
                Id = newId, AccountId = 1, ProcessDate = DateTime.Now, TransactionProcess = ProcessesType.Check
            });
            _serviceTransaction.Insert(new Transaction {
                Id = 1, AccountId = 2, ProcessDate = DateTime.Now, TransactionProcess = ProcessesType.CreditRequest
            });

            //when
            var result = _serviceTransaction.GetAll();

            //then
            result.Data.Any(x => x.Id == newId).Should().BeTrue();
            result.Data.Count().Should().BeGreaterOrEqualTo(2);
        }
Exemplo n.º 4
0
 public int Insert(TEntity obj)
 {
     return(_business.Insert(obj));
 }
Exemplo n.º 5
0
 public void Insert(TEntity obj)
 {
     _business.Insert(obj);
 }