Exemplo n.º 1
0
        public void MakePaymentShouldFailWhenTheAccountDoesNotAllowThePaymentSchemaRequested()
        {
            var serviceUnderTest = new PaymentService(accountDataStoreFactory.GetAccountDataStore());

            var response = serviceUnderTest.MakePayment(request);

            Assert.AreEqual(false, response.Success);
        }
Exemplo n.º 2
0
        public void IsDefaultFactoryReturned()
        {
            var mockAppConfig = A.Fake <IAppConfig>();

            A.CallTo(() => mockAppConfig.GetValueByKey("DataStoreType")).Returns("Live");

            var mockAccountDataStoreFactory = new AccountDataStoreFactory(mockAppConfig);

            Assert.True(mockAccountDataStoreFactory != null);

            var mockAccountDataStore = mockAccountDataStoreFactory.GetAccountDataStore();

            Assert.True(mockAccountDataStore != null);

            Assert.Equal("AccountDataStore", mockAccountDataStore.GetType().Name);
        }
Exemplo n.º 3
0
        public void WhenDataStoreTypeIsNotBackendThenNormalAccountReturned()
        {
            var accountDataStore = _accountDataStoreFactory.GetAccountDataStore();

            Assert.That(accountDataStore, Is.TypeOf <AccountDataStore>());
        }