Esempio n. 1
0
        public void Test_ToanService_As_Moq()
        {
            //Arrangement
            double             beginningBalance = 11.99;
            BankAccount        account          = new() { CustomerName = "Mr. Dionysios Dionysiou", Balance = beginningBalance };
            Mock <LoanService> loanServiceMock  = new();

            loanServiceMock.Setup(x => x.CheckEmployeeMethod()).Returns(true);
            BankService bankService = new BankService(loanServiceMock.Object)
            {
                BankAccount = account
            };

            //action
            bool result   = bankService.CheckCustomer();
            bool expected = true;

            //Assertion
            Assert.AreEqual(expected, result);
        }