Esempio n. 1
0
        public GitDbSyncServiceTests(GitDbFixture fixture) : base(fixture)
        {
            _options    = ServiceProvider.GetRequiredService <IOptions <PineBlogGitDbOptions> >();
            _loggerMock = new Mock <ILogger <GitDbSyncService> >();

            _gitDbSyncService = new TestGitDbSyncService(_options, _loggerMock.Object);
        }
Esempio n. 2
0
        public BlogUnitOfWorkTests(GitDbFixture fixture) : base(fixture)
        {
            var options      = ServiceProvider.GetRequiredService <IOptions <PineBlogGitDbOptions> >();
            var gitDbContext = ServiceProvider.GetRequiredService <GitDbContext>();

            _uow = new BlogUnitOfWork(gitDbContext, options);
        }
        public BlogSettingsConfigurationProviderTests(GitDbFixture fixture) : base(fixture)
        {
            _options = ServiceProvider.GetRequiredService <IOptions <PineBlogGitDbOptions> >();

            _provider = new BlogSettingsConfigurationProvider(new BlogSettingsConfigurationSource
            {
                Options        = _options.Value,
                ReloadOnChange = true
            });
        }
Esempio n. 4
0
        public GitDbTestsBase(GitDbFixture fixture)
        {
            _fixture = fixture;

            Configuration = new ConfigurationBuilder()
                            .AddJsonFile("appsettings.json")
                            .AddPineBlogGitDbConfiguration(reloadOnChange: false)
                            .Build();

            Services = new ServiceCollection();
            Services.AddPineBlogCore(Configuration);
            Services.AddPineBlogGitDb(Configuration);

            // add a mock logger for the GitDbSyncService
            Services.AddScoped((_) => new Mock <ILogger <GitDbSyncService> >().Object);
        }
Esempio n. 5
0
 public ServiceCollectionExtensionsTests(GitDbFixture fixture) : base(fixture)
 {
 }