public ProjectsSummaryReportsApiTests()
        {
            var endpoints = new Endpoints(ApiEnvironment.Staging);

            apiClient  = Substitute.For <IApiClient>();
            serializer = new JsonSerializer();
            client     = new ProjectsSummaryApi(endpoints, apiClient, serializer, Credentials.None);
        }
Ejemplo n.º 2
0
        public ReportsProvider(ITogglApi api, ITogglDatabase database)
        {
            Ensure.Argument.IsNotNull(api, nameof(api));
            Ensure.Argument.IsNotNull(database, nameof(database));

            projectsApi        = api.Projects;
            projectsRepository = database.Projects;
            projectSummaryApi  = api.ProjectsSummary;
        }
Ejemplo n.º 3
0
        public GetProjectSummaryInteractor(
            ITogglApi api,
            ITogglDatabase database,
            IAnalyticsService analyticsService,
            ReportsMemoryCache memoryCache,
            long workspaceId,
            DateTimeOffset startDate,
            DateTimeOffset?endDate)
            : base(analyticsService)
        {
            Ensure.Argument.IsNotNull(api, nameof(api));
            Ensure.Argument.IsNotNull(database, nameof(database));

            projectsApi           = api.Projects;
            projectsRepository    = database.Projects;
            clientsRepository     = database.Clients;
            projectSummaryApi     = api.ProjectsSummary;
            timeEntriesReportsApi = api.TimeEntriesReports;

            this.endDate     = endDate;
            this.startDate   = startDate;
            this.workspaceId = workspaceId;
            this.memoryCache = memoryCache;
        }