Пример #1
0
 public ExchangeRateServiceTests()
 {
     TestServicesProvider.GetModelTestData().FillData();
     context             = TestServicesProvider.GetContext();
     exchangeRateService = TestServicesProvider.GetExchangeRateService();
     accountService      = TestServicesProvider.GetAccountService();
 }
Пример #2
0
        public async void GetTransfersModelsOnlyNotConfirm()
        {
            var mockUserService       = new Mock <IUserService>();
            var mockTransferService   = new Mock <ITransferService>();
            var mockEmployeeService   = new Mock <IEmployeeService>();
            var mockValidationService = new Mock <IValidationService>();

            mockTransferService.Setup(t => t.GetNotConfirmedTransferViewModelsByCompanyId(new User())).Returns(GetNotConfirmedTransferViewModels(new User()));
            mockUserService.Setup(t => t.FindUserByName(string.Empty)).Returns(new User());
            mockEmployeeService.Setup(t => t.GetEmployeeInfoByUserId("someId")).Returns(GetNullEmployeeInfo("someId"));
            mockUserService.Setup(t => t.FindUserInfoByUserId("userId")).ReturnsAsync(new UserInfo());


            TransferController transferController = new TransferController(TestServicesProvider.GetSelectListService(),
                                                                           mockUserService.Object, mockTransferService.Object, TestServicesProvider.GetAccountService(), null, new PagingService(),
                                                                           mockEmployeeService.Object, TestServicesProvider.GetCompanyService(), TestServicesProvider.GetExchangeRateService(),
                                                                           mockValidationService.Object, TestServicesProvider.GetDocumentFormatService(), TestServicesProvider.GetTemplateService(),
                                                                           TestServicesProvider.GetPdfCreateAndLoadService(), TestServicesProvider.GetCurrencyService(), new HostingEnvironment()
                                                                           );
            //TransferController  transferController = new TransferController(TestServicesProvider.GetSelectListService(), null, mockTransferService.Object, TestServicesProvider.GetAccountService(), null, new PagingService(), null, TestServicesProvider.GetCompanyService(), TestServicesProvider.GetExchangeRateService(), null, TestServicesProvider.GetDocumentFormatService(), TestServicesProvider.GetTemplateService(), TestServicesProvider.GetPdfCreateAndLoadService(), TestServicesProvider.GetCurrencyService(), null);
            var result = await transferController.GetTransfers(section : "not_confirmed");// as ViewResult;

            Assert.NotNull(result);
        }
 public CurrencyServiceTests()
 {
     context         = TestServicesProvider.GetContext();
     currencyService = new CurrencyService(context);
     TestServicesProvider.GetModelTestData().FillData();
 }
 public AccountServiceTests()
 {
     context = TestServicesProvider.GetContext();
     TestServicesProvider.GetModelTestData().FillData();
     accountService = TestServicesProvider.GetAccountService();
 }
Пример #5
0
 public TransferControllerTests()
 {
     context = TestServicesProvider.GetContext();
 }
 public IExchangeRateServiceTests()
 {
     context             = TestServicesProvider.GetContext();
     exchangeRateService = new ExchangeRateService(context, accountService);
 }
 public UserServiceTests()
 {
     TestServicesProvider.GetModelTestData().FillData();
     context = TestServicesProvider.GetContext();
 }
Пример #8
0
 public GeneratePasswordServiceTests()
 {
     generatePasswordService = TestServicesProvider.GetGeneratePasswordService();
     result = generatePasswordService.CreatePassword();
     TestServicesProvider.GetModelTestData().FillData();
 }
Пример #9
0
 public TransactionServiceTests()
 {
     TestServicesProvider.GetModelTestData().FillData();
     context            = TestServicesProvider.GetContext();
     transactionService = TestServicesProvider.GetTransactionService();
 }
Пример #10
0
 public EmailServerTests()
 {
     emailService = TestServicesProvider.GetEmailService();
     TestServicesProvider.GetModelTestData().FillData();
 }