Esempio n. 1
0
        public void GetBankAccount_Should_ReturnBankAccountDto_When_BankAccountIsFound()
        {
            var okResult = _sut.GetBankAccount(1).Result as OkObjectResult;

            Assert.IsNotNull(okResult);
            Assert.IsInstanceOfType(okResult.Value, typeof(BankAccountDto));

            var bankAccountDto = okResult.Value as BankAccountDto;

            Assert.IsNotNull(bankAccountDto);
            Assert.AreEqual(_firstBankAccount.Id, bankAccountDto.Id);
            Assert.AreEqual(_firstBankAccount.AccountType, bankAccountDto.AccountType);
            Assert.AreEqual(_firstBankAccount.Currency, bankAccountDto.Currency);
            Assert.AreEqual(_firstBankAccount.CountryCode, bankAccountDto.CountryCode);
            Assert.AreEqual(_firstBankAccount.CheckDigits, bankAccountDto.CheckDigits);
            Assert.AreEqual(_firstBankAccount.NationalBankCode, bankAccountDto.NationalBankCode);
            Assert.AreEqual(_firstBankAccount.BranchCode, bankAccountDto.BranchCode);
            Assert.AreEqual(_firstBankAccount.NationalCheckDigit, bankAccountDto.NationalCheckDigit);
            Assert.AreEqual(_firstBankAccount.AccountNumber, bankAccountDto.AccountNumber);
            Assert.AreEqual(_firstBankAccount.AccountNumberText, bankAccountDto.AccountNumberText);
            Assert.AreEqual(_firstBankAccount.Iban, bankAccountDto.Iban);
            Assert.AreEqual(_firstBankAccount.IbanSeparated, bankAccountDto.IbanSeparated);
            Assert.AreEqual(_firstBankAccount.Balance, bankAccountDto.Balance);
            Assert.AreEqual(_firstBankAccount.DebitLimit, bankAccountDto.DebitLimit);
            Assert.AreEqual(_firstBankAccount.CustomerId, bankAccountDto.CustomerId);
            Assert.AreEqual(_firstBankAccount.CreatedById, bankAccountDto.CreatedById);
        }
        public async Task GetBankAccountByGuidTest()
        {
            var result = await _controller.GetBankAccount(new Guid("bd877de3-d2c9-4237-b5ca-08bd3ba56cd8"));

            var contentResult = result as OkNegotiatedContentResult <BankAccount>;

            Assert.IsNotNull(contentResult);
            Assert.AreEqual(_givenBankAccounts[0], contentResult.Content);
        }