Esempio n. 1
0
        public void Bank_CreateNewInstance_CurrencyPairFieldsHasCorrectNames()
        {
            var fakeProvider = Substitute.For<IFinancialInfoProvider>();

            Bank bank = new Bank(BankTests.BANK_NAME, fakeProvider);
            
            Assert.That(bank.USDtoRUB.Name, Is.EqualTo(BankTests.USD_RUB_NAME));
            Assert.That(bank.EURtoRUB.Name, Is.EqualTo(BankTests.EUR_RUB_NAME));
        }
Esempio n. 2
0
        public void RefreshData_Execution_ShouldUpdateCurrencyPairFields()
        {
            Bank bank = new Bank(BankTests.BANK_NAME, this.prePreparedFakeProvider);


            bank.RefreshData();


            Assert.That(bank.USDtoRUB.Bid, Is.EqualTo(BankTests.USD_BID));
            Assert.That(bank.USDtoRUB.Ask, Is.EqualTo(BankTests.USD_ASK));

            Assert.That(bank.EURtoRUB.Bid, Is.EqualTo(BankTests.EUR_BID));
            Assert.That(bank.EURtoRUB.Ask, Is.EqualTo(BankTests.EUR_ASK));
        }
Esempio n. 3
0
        public void RefreshData_Execution_ShouldRaiseEvent()
        {
            bool eventHasRaised = false;

            Bank bank = new Bank(BankTests.BANK_NAME, this.prePreparedFakeProvider);
            bank.DataRefreshed += (sender, args) => { eventHasRaised = true; };


            bank.RefreshData();


            Assert.That(eventHasRaised, Is.True);
        }
Esempio n. 4
0
        public void IsDataInitialized_RefreshDataExecution_ShouldReturnsTrue()
        {
            Bank bank = new Bank(BankTests.BANK_NAME, this.prePreparedFakeProvider);


            bank.RefreshData();

            
            Assert.That(bank.IsDataInitialized, Is.True);
        }
Esempio n. 5
0
        public void IsDataInitialized_CreateNewBankInstance_ShouldReturnsFalse()
        {
            var fakeProvider = Substitute.For<IFinancialInfoProvider>();


            Bank bank = new Bank(BankTests.BANK_NAME, fakeProvider);


            Assert.That(bank.IsDataInitialized, Is.False);
        }