/// <summary> /// Create <see cref="ContentsControllerTests"/>. /// </summary> public ContentsControllerTests() { // Dependencies initializations var connection = InMemoryConnectionHelper.SetupConnection(); var services = new ServiceCollection(); services.AddEntityFrameworkSqlite() .AddDbContext <DataDbContext>(options => options.UseSqlite(connection), ServiceLifetime.Transient ); var serviceProvider = services.BuildServiceProvider(); var pageConfiguration = new PageConfiguration(); _dataDbContext = serviceProvider.GetService <DataDbContext>(); _dataDbContext.Database.EnsureCreated(); var contentRepository = new ContentViewerRepository(_dataDbContext); var humanReadableContentService = new HumanReadableContentRetrievalService(pageConfiguration, contentRepository); var languageManipulationService = new LanguageManipulationService(); // Controller initialization _contentsController = new ContentsController( pageConfiguration, humanReadableContentService, languageManipulationService ); }
/// <summary> /// Create <see cref="CustomUrlStringCultureProviderTest"/>. /// </summary> public CustomUrlStringCultureProviderTest() { var languageManipulationService = new LanguageManipulationService(); _cultureProvider = new CustomUrlStringCultureProvider( languageManipulationService); }