Ejemplo n.º 1
0
        public GoogleSheetsUpdater(IServiceProvider serviceProvider, IConfiguration configuration)
        {
            _configuration       = configuration;
            _googleSheetsService = serviceProvider.GetService <IGoogleSheetsService>();
            _coverageReader      = serviceProvider.GetService <ICoverageReader>();

            _sheetsId = _configuration["Google:Sheets:Id"];
            _interval = int.Parse(_configuration["Google:Sheets:Interval"]);

            Console.WriteLine($"Target Sheets ID: {_sheetsId}");
        }
        public GoogleSheetUpdaterTest()
        {
            this._stubFileHelper          = Substitute.For <IFileHelper>();
            this._stubConfiguration       = Substitute.For <IConfiguration>();
            this._stubGoogleSheetsService = Substitute.For <IGoogleSheetsService>();
            this._stubCoverageReader      = Substitute.For <ICoverageReader>();

            this._stubServiceProvider = Substitute.For <IServiceProvider>();
            this._stubServiceProvider.GetService <IFileHelper>().Returns(this._stubFileHelper);
            this._stubServiceProvider.GetService <IConfiguration>().Returns(this._stubConfiguration);
            this._stubServiceProvider.GetService <IGoogleSheetsService>().Returns(this._stubGoogleSheetsService);
            this._stubServiceProvider.GetService <ICoverageReader>().Returns(this._stubCoverageReader);
        }