Ejemplo n.º 1
0
 public async Task <OperationResult <List <Payment> > > GetPortfolioPayments(
     [CurrentUserIdGlobalState] int userId,
     [Service] IPortfolioService portfolioService,
     int portfolioId)
 {
     return(await portfolioService.GetPortfolioPayments(portfolioId, userId));
 }
Ejemplo n.º 2
0
 public GradFolioController(
     ILoggingService loggingService,
     IPortfolioService portfolioService)
 {
     _loggingService   = loggingService;
     _portfolioService = portfolioService;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PortfolioServiceTests"/> class.
        /// </summary>
        public PortfolioServiceTests()
        {
            this.repo    = new Mock <IRepository <Investment> >();
            this.pricing = new Mock <IStockPriceService>();

            this.sut = new PortfolioService(this.repo.Object, this.pricing.Object);
        }
Ejemplo n.º 4
0
 public PortfolioControllerTest()
 {
     this.unitOfWork = new FakeUnitOfWork();
     this.service    = new PortfolioService(unitOfWork);
     this.controller = new PortfolioController(service);
     InitializeMappings();
 }
Ejemplo n.º 5
0
        public void Setup()
        {
            var mockHttp = new MockHttpMessageHandler();
            var client   = mockHttp.ToHttpClient();

            var stockMarketAPI  = new StockMarketAPI(client);
            var stockMarketData = new StockMarketData(stockMarketAPI);

            TestHelpers.MockStockData(mockHttp);
            TestHelpers.MockFondData(mockHttp);
            TestHelpers.MockBondData(mockHttp);

            TestHelpers.MockDividendData(mockHttp);
            TestHelpers.MockCouponsData(mockHttp);

            var context = TestHelpers.GetMockFinanceDbContext();

            TestHelpers.SeedOperations1(context);

            _financeDataService = new FinanceDataService(context);
            var assetFactory   = new AssetsFactory(_financeDataService, stockMarketData);
            var balanceService = new BalanceService(_financeDataService);

            _marketService    = new MarketService(_financeDataService, assetFactory, balanceService);
            _portfolioService = new PortfolioService(_financeDataService, balanceService, assetFactory);
        }
Ejemplo n.º 6
0
 public ServiceCatalogController(ICatalogController catalogController, IPortfolioService portfolioService)
 {
     _catalogController = catalogController;
     _portfolioService  = portfolioService;
     try { _pageSize = ConfigHelper.GetPaginationSize(); }                   //set pagination size
     catch (Exception) { _pageSize = 12; /*just in case */ }
 }
Ejemplo n.º 7
0
 public HrService(
     IStudentService studentService, IResumeService resumeService, IUserInfoService userInfoService,
     IStreamService streamService, ISummaryService summaryService,
     ISkillService skillService, IForeignLanguageService languageService, IEducationService educationService,
     ICourseService courseService, ICertificateService certificateService, IExamService examService,
     IWorkExperienceService workExperienceService, IPortfolioService portfolioService, IMilitaryStatusService militaryStatusService,
     IRecommendationService recommendationService, IAdditionalInfoService additionalInfoService
     )
 {
     _userInfoService       = userInfoService;
     _studentService        = studentService;
     _resumeService         = resumeService;
     _streamService         = streamService;
     _summaryService        = summaryService;
     _skillService          = skillService;
     _languageService       = languageService;
     _educationService      = educationService;
     _courseService         = courseService;
     _certificateService    = certificateService;
     _examService           = examService;
     _workExperienceService = workExperienceService;
     _portfolioService      = portfolioService;
     _militaryStatusService = militaryStatusService;
     _additionalInfoService = additionalInfoService;
     _recommendationService = recommendationService;
 }
Ejemplo n.º 8
0
        public async Task <OperationResult> CreatePortfolio([CurrentUserIdGlobalState] int userId,
                                                            [Service] IPortfolioService portfolioService, string name)
        {
            var result = await portfolioService.CreatePortfolio(name, userId);

            return(result);
        }
Ejemplo n.º 9
0
 public LandingPageService(IPortfolioService PortfolioService, IMediaDashboardService MediaDashboardService, IMyHomeService MyHomeService, IHardwareMonitorService HardwareService)
 {
     portfolioService      = PortfolioService;
     mediaDashboardService = MediaDashboardService;
     myHomeService         = MyHomeService;
     hardwareService       = HardwareService;
 }
Ejemplo n.º 10
0
 public TaskService(IMapper mapper, ITaskManager taskManager, IFundService fund, IPortfolioService portfolio)
 {
     _mapper      = mapper;
     _taskManager = taskManager;
     _fund        = fund;
     _portfolio   = portfolio;
 }
        public PortfolioControllerTests()
        {
            var logger = Mock.Of <ILogger <PortfolioController> >();

            portfolioService    = new DummyPortfolioService();
            portfolioController = new PortfolioController(portfolioService, logger);
        }
Ejemplo n.º 12
0
        public async Task <OperationResult> AddPaymentInPortfolio([CurrentUserIdGlobalState] int userId,
                                                                  [Service] IPortfolioService portfolioService, PaymentInput paymentInput)
        {
            var result = await portfolioService.AddPaymentInPortfolio(paymentInput.PortfolioId, userId,
                                                                      paymentInput.Ticket, paymentInput.Amount, paymentInput.PaymentValue, paymentInput.Date);

            return(result);
        }
Ejemplo n.º 13
0
 public AuthenticationService(IUnitOfWork unitOfWork, IUsersService usersService, IOptions <AppSettings> appSettings, IPortfolioService portfolioService, IBankService bankService)
 {
     this._bankService      = bankService;
     this._portfolioService = portfolioService;
     _usersService          = usersService;
     _appSettings           = appSettings;
     _unitOfWork            = (UnitOfWork)unitOfWork;
 }
Ejemplo n.º 14
0
 public BaseController()
 {
     landingPageService    = DependencyResolver.Current.GetService <ILandingPageService>();
     portfolioService      = DependencyResolver.Current.GetService <IPortfolioService>();
     mediaDashboardService = DependencyResolver.Current.GetService <IMediaDashboardService>();
     myHomeService         = DependencyResolver.Current.GetService <IMyHomeService>();
     hardwareService       = DependencyResolver.Current.GetService <IHardwareMonitorService>();
 }
Ejemplo n.º 15
0
 public SellerService(IBankService bankService,
                      IPortfolioService portfolioService,
                      ITraderService traderService)
 {
     this._bankService      = bankService;
     this._portfolioService = portfolioService;
     this._traderService    = traderService;
 }
Ejemplo n.º 16
0
 public static IServiceRequestPackageDto GetPackage(int userId, IPortfolioService portfolioService, int?serviceOptionId) //overload
 {
     if (serviceOptionId.HasValue)                                                                                       //invalid input
     {
         return(GetPackage(userId, portfolioService, serviceOptionId.Value));
     }
     throw new Exception("Cannot retrieve package, Invalid Service Option parameter");                       //you have reached a dangerous place
 }
Ejemplo n.º 17
0
 public PortfolioController(
     IPortalService portalService,
     IPortfolioService portfolioService,
     ILoggingService loggingService)
 {
     _portalService    = portalService;
     _portfolioService = portfolioService;
     _loggingService   = loggingService;
 }
 public PropertyController(IPropertyService propertyService, IPropertyImageService propertyImageService, IPropertyDocumentService propertyDocumentService, IPortfolioService portfolioService, IMapper mapper, UserManager <ApplicationUser> userManager)
 {
     _propertyService         = propertyService;
     _propertyImageService    = propertyImageService;
     _propertyDocumentService = propertyDocumentService;
     _portfolioService        = portfolioService;
     _mapper      = mapper;
     _userManager = userManager;
 }
Ejemplo n.º 19
0
        private static void DisplayPortfolioValue()
        {
            IPortfolioService srv = ServiceLocator.Current.GetInstance <IPortfolioService>();

            decimal value = srv.GetPortfolioValue();

            Console.WriteLine($"The portfolio value is: {value:C2}");
            ConsoleWriteSeparator();
        }
        public ProjectsController(IPortfolioService provider, IProjectDataService projectDataService)
        {
            this.portfolioService   = provider;
            this.projectDataService = projectDataService;

#if DEBUG
            AppLog.TraceVerbose($"{nameof(ProjectsController)} created.");
#endif
        }
Ejemplo n.º 21
0
 public PortfolioController(IPortfolioService portfolioService, IFundService fundService, IHomepageCMSService homepageCMSService, IConfiguration configuration, IUserService userService, IEmailSender emailSender)
 {
     _portfolioService   = portfolioService;
     _homepageCMSService = homepageCMSService;
     _fundService        = fundService;
     _configuration      = configuration;
     _userService        = userService;
     _emailSender        = emailSender;
 }
Ejemplo n.º 22
0
 public PortfolioCategoryController(
     IPortfolioService _portfolioService,
     IPortfolioCategoryService _portfolioCategoryService,
     IUrlService _urlService)
 {
     portfolioService         = _portfolioService;
     portfolioCategoryService = _portfolioCategoryService;
     urlService = _urlService;
 }
Ejemplo n.º 23
0
 public FinbotBrain(string token, IServiceProvider services)
 {
     this.token            = token;
     this.services         = services;
     this.logger           = services.GetRequiredService <ILogger <FinbotBrain> >();
     this.portfolioManager = services.GetRequiredService <IPortfolioService>();
     this.finDataClient    = services.GetRequiredService <IFinDataClient>();
     this.client           = services.GetRequiredService <DiscordSocketClient>();
     this.commands         = services.GetRequiredService <CommandService>();
 }
Ejemplo n.º 24
0
 public ServiceRequestController(IPortfolioService portfolioService, IServiceRequestController serviceRequestController,
                                 IRequestManager requestManager, IServiceRequestOptionController serviceRequestOptionController,
                                 IServiceRequestUserInputController serviceRequestUserInputController)
 {
     _portfolioService                  = portfolioService;
     _requestManager                    = requestManager;
     _serviceRequestController          = serviceRequestController;
     _serviceRequestOptionController    = serviceRequestOptionController;
     _serviceRequestUserInputController = serviceRequestUserInputController;
 }
Ejemplo n.º 25
0
        public PortfoliosController(IPortfolioService portfolioService, IProjectDataService projectDataService, ISyncService syncService)
        {
            this.portfolioService   = portfolioService;
            this.projectDataService = projectDataService;
            this.syncService        = syncService;

#if DEBUG
            AppLog.TraceVerbose($"{nameof(PortfoliosController)} created.");
#endif
        }
Ejemplo n.º 26
0
        private void GetAsyncResponse(User user, CreatePortfolioCommand cmd, HttpContext context)
        {
            HttpContext.Current = new HttpContext(context.Request, context.Response);

            service = WebApiApplication.Container.Resolve <IPortfolioService>();
            var vm = service.CreatePortfolio(user, cmd);

            WebApiApplication.Container.Release(service);
            //CacheHelper.Delete(user.Username + "portfolio");
            this.Hub.Clients.Client(WebApiApplication.hubUsers[user.UserID]).update(Newtonsoft.Json.JsonConvert.SerializeObject(vm));
        }
Ejemplo n.º 27
0
 public NavController(IPortfolioService portfolioService, ISymbolViewService symbolViewService,
                      ITradeSybolService tradeSybolService, IViewTemplateService viewTemplateService,
                      IViewTemplateColumnService viewTemplateColumnService, IViewService viewService)
 {
     this.portfolioService          = portfolioService;
     this.symbolViewService         = symbolViewService;
     this.tradeSybolService         = tradeSybolService;
     this.viewTemplateService       = viewTemplateService;
     this.viewTemplateColumnService = viewTemplateColumnService;
     this.viewService = viewService;
 }
Ejemplo n.º 28
0
 public DBInit(IMarketDataService marketDataSvc,
               ITickerService tickerSvc,
               IPortfolioService PortfolioSvc,
               ITradeService tradeSvc)
 {
     this.marketDataSvc = marketDataSvc;
     this.tickerSvc     = tickerSvc;
     this.PortfolioSvc  = PortfolioSvc;
     this.tradeSvc      = tradeSvc;
     xmlDBInit();
 }
        public ServiceRequestApprovalController(IPortfolioService portfolioService, IServiceRequestController serviceRequestController,
                                                IRequestManager requestManager, IUserManager userManager)
        {
            _portfolioService         = portfolioService;
            _serviceRequestController = serviceRequestController;
            _requestManager           = requestManager;
            _userManager = userManager;

            try { _pageSize = ConfigHelper.GetPaginationSize(); }
            catch (Exception) { _pageSize = 12; }                   //just in case
        }
Ejemplo n.º 30
0
 public PortfolioController(IPortfolioCategoryService _portfolioCategoryService,
                            IPortfolioService _portfolioService,
                            IUrlService _urlService,
                            IMediaStorageService _mediaStorageService,
                            ISocialNetworkService _socialNetworkService)
 {
     portfolioCategoryService = _portfolioCategoryService;
     portfolioService         = _portfolioService;
     urlService          = _urlService;
     mediaStorageService = _mediaStorageService;
 }
Ejemplo n.º 31
0
 public HomeController(IImageService imageService, IPortfolioService portfolioService)
 {
     this.imageService = imageService;
     this.portfolioService = portfolioService;
 }
 public PortfolioPresenter(IPortfolioRepository portfolioRepository, IPortfolioService portfolioService, IConfigRepository configRepository)
 {
     _portfolioRepo = portfolioRepository;
     _configRepo = configRepository;
     _portfolioSvc = portfolioService;
 }
Ejemplo n.º 33
0
 public MainController(IPortfolioService portfolioService, IMailService mailService)
 {
     _portfolioService = portfolioService;
     _mailService = mailService;
 }
Ejemplo n.º 34
0
 public AdminController(IPortfolioService portfolioService, IImageService imageService, IVideoService videoService)
 {
     _portfolioService = portfolioService;
     _imageService = imageService;
     _videoService = videoService;
 }