public ExchangeRateServiceTests() { TestServicesProvider.GetModelTestData().FillData(); context = TestServicesProvider.GetContext(); exchangeRateService = TestServicesProvider.GetExchangeRateService(); accountService = TestServicesProvider.GetAccountService(); }
public AccountServiceTests() { context = TestServicesProvider.GetContext(); TestServicesProvider.GetModelTestData().FillData(); accountService = TestServicesProvider.GetAccountService(); }
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); }