コード例 #1
0
        public GitDbSyncServiceTests(GitDbFixture fixture) : base(fixture)
        {
            _options    = ServiceProvider.GetRequiredService <IOptions <PineBlogGitDbOptions> >();
            _loggerMock = new Mock <ILogger <GitDbSyncService> >();

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

            _uow = new BlogUnitOfWork(gitDbContext, options);
        }
コード例 #3
0
        public BlogSettingsConfigurationProviderTests(GitDbFixture fixture) : base(fixture)
        {
            _options = ServiceProvider.GetRequiredService <IOptions <PineBlogGitDbOptions> >();

            _provider = new BlogSettingsConfigurationProvider(new BlogSettingsConfigurationSource
            {
                Options        = _options.Value,
                ReloadOnChange = true
            });
        }
コード例 #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);
        }
コード例 #5
0
 public ServiceCollectionExtensionsTests(GitDbFixture fixture) : base(fixture)
 {
 }