Пример #1
0
        public AccountInfoTests()
        {
            var config = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(new WebApi.Mappings.AutoMapper());
            });
            var mapper = config.CreateMapper();
            IQueryable <Customer> customersData = new List <Customer>
            {
                new Customer {
                    FirstName = "Rena", LastName = "Markiewitz", Email = "*****@*****.**", CustomerId = new Guid("E7775225-9C97-4460-D971-08D82BD1D7C5"), Password = "******", Salt = "/PAaJXFGVGOxEWdGHv9TD+P6s9DaYmTws8ZMUkCp9Ow="
                },
            }.AsQueryable();
            var accountsData = new List <Data.Entities.Account>
            {
                new Data.Entities.Account {
                    AccountId = new Guid("9CFE55DF-65E2-4204-BAD5-08D82BD21687"), Balance = 1000000, Customer = customersData.FirstOrDefault(c => c.CustomerId == new Guid("E7775225-9C97-4460-D971-08D82BD1D7C5")), OpenDate = Convert.ToDateTime("2020-07-19 13:03:43.4326053"), CustomerId = new Guid("E7775225-9C97-4460-D971-08D82BD1D7C5")
                },
            }.AsQueryable();
            var emailVerificationsData = new List <EmailVerification>
            {
                new EmailVerification {
                    Email = "*****@*****.**", VerificationCode = 1234, ExpirationTime = DateTime.Now.AddDays(1)
                },
            }.AsQueryable();
            var context = new Mock <AccountContext>();

            context.SetupGet(x => x.Customers).Returns(MockDBSetExtensions.GetDbSet(customersData).Object);
            context.SetupGet(x => x.Accounts).Returns(MockDBSetExtensions.GetDbSet(accountsData).Object);
            context.SetupGet(x => x.EmailVerifications).Returns(MockDBSetExtensions.GetDbSet(emailVerificationsData).Object);
            var accountInfoRepository = new AccountInfoRepository(context.Object, mapper);

            _service = new AccountInfoService(accountInfoRepository);
        }
Пример #2
0
 private void AssertAccountFundTransferAccountExists(IAccountInfoService accountService, string accountNumber)
 {
     if (!accountService.AccountNumberExists(accountNumber))
     {
         throw new InactiveAccountFundTransferException(AccountDoesNotExisteption, Id, accountNumber);
     }
 }
Пример #3
0
 public ShellViewModel(IShellView view, IAccountInfoService accountInfoService) : base(view)
 {
     AccountInfoService          = accountInfoService;
     messages                    = new ObservableCollection <KeyValuePair <string, Exception> >();
     Messages                    = new ReadOnlyObservableList <KeyValuePair <string, Exception> >(messages);
     CloseMessageCommand         = new DelegateCommand(CloseMessage);
     messages.CollectionChanged += MessagesCollectionChanged;
 }
Пример #4
0
 public CheckoutController(IUserProfileService userProfileService, IOrderService orderService,
                           IOfferService offerService, IAccountInfoService accountInfoService,
                           IOrderStatusService orderStatusService, IBillingService billingService,
                           ITransactionService transactionService, IIdentityMessageService identityMessageService, IWithdrawService withdrawService)
 {
     _orderStatusService     = orderStatusService;
     _userProfileService     = userProfileService;
     _orderService           = orderService;
     _offerService           = offerService;
     _accountInfoService     = accountInfoService;
     _billingService         = billingService;
     _transactionService     = transactionService;
     _identityMessageService = identityMessageService;
     _withdrawService        = withdrawService;
 }
Пример #5
0
 public AccountInfoController(IAccountInfoService accountInfoService)
 {
     _accountInfoService = accountInfoService;
 }
Пример #6
0
 public ResultController(IResultService resultService, IPdfGenerator pdfGenerator, IAccountInfoService accountInfoService)
 {
     _resultService      = resultService;
     _accountInfoService = accountInfoService;
     _pdfGenerator       = pdfGenerator;
 }
Пример #7
0
 public ResultReport(IResultService resultService, IBudgetService budgetService, IAccountInfoService accountInfoService)
 {
     _resultService      = resultService;
     _accountInfoService = accountInfoService;
     _budgetService      = budgetService;
 }
Пример #8
0
 public PdfGenerator(IResultService resultService, IBudgetService budgetService, IAccountInfoService accountInfoService)
 {
     _resultService      = resultService;
     _accountInfoService = accountInfoService;
     _budgetService      = budgetService;
 }
Пример #9
0
 public LoginController(IMapper mapper, ILoginService loginService, IAccountInfoService accountInfoService)
 {
     _loginService       = loginService;
     _mapper             = mapper;
     _accountInfoService = accountInfoService;
 }
Пример #10
0
 public AccountInfoController(IAccountInfoService accountInfoService)
 {
     _accountInfoService = accountInfoService;
 }
Пример #11
0
 public ResultReport(IResultService resultService, IBudgetService budgetService, IAccountInfoService accountInfoService)
 {
     _resultService = resultService;
     _accountInfoService = accountInfoService;
     _budgetService = budgetService;
 }
Пример #12
0
 public PdfGenerator(IResultService resultService, IBudgetService budgetService, IAccountInfoService accountInfoService)
 {
     _resultService = resultService;
     _accountInfoService = accountInfoService;
     _budgetService = budgetService;
 }