public void ShouldReturnTranslation() { var language = new Language("SV", "Svenska"); var service = new CategoryTranslationService(); var repository = new CategoryRepository(); var category = repository.FindByCode("a"); Assert.That(service.Translate(category, language), Is.EqualTo("Människor")); }
/// <summary> /// Should be refactored to use proper dependency injection. /// </summary> private void createDependencyGraph() { this.fileLogger = new FileLogger(); this._languageSelection = new LanguageSelection(); this._authenticationService = new AuthenticationService(); this.categoryRepository = new CategoryRepository(); this.categoryTranslationService = new CategoryTranslationService(); this.pictogramRestService = new PictogramRestService("www.pictogram.se"); this.languageProvider = new LanguageProvider(this.pictogramRestService); this.iniFileFactory = new IniFileFactory(); this.config = new Config(this.categoryRepository, this.categoryTranslationService, this.iniFileFactory); this.downloadManager = new DownloadManager(this.languageProvider, this.pictogramRestService); this.downloadListManager = new DownloadListManager(this.pictogramRestService); this.installationManager = new InstallationManager(this.config, this.downloadListManager, this.languageProvider, this.pictogramRestService); this.imageFormatProvider = new ImageFormatProvider(); this.hargdata = new HargdataProducts(); }
public Config(CategoryRepository categoryRepository, CategoryTranslationService categoryTranslationService, IniFileFactory iniFileFactory) { _queue = new List<PictogramEntry>(); this.categoryRepository = categoryRepository; this.categoryTranslationService = categoryTranslationService; this.iniFileFactory = iniFileFactory; }
/// <summary> /// Should be refactored to use proper dependency injection. /// </summary> private void createDependencyGraph() { this._languageSelection = new LanguageSelection(); this._authenticationService = new AuthenticationService(); this.categoryRepository = new CategoryRepository(); this.categoryTranslationService = new CategoryTranslationService(); this.languageProvider = new LanguageProvider(); this.pictosysWebService = new PictosysWebService(); this._config = new Config(this.categoryRepository, this.categoryTranslationService); this.downloadManager = new DownloadManager(this.languageProvider, this.pictosysWebService); this.downloadListManager = new DownloadListManager(this.pictosysWebService); this.installationManager = new InstallationManager(this._config, this.downloadListManager, this.languageProvider, this.pictosysWebService); }
public void ShouldReturnAllCategories() { var repository = new CategoryRepository(); Assert.That(repository.FindAll().Count, Is.EqualTo(26)); }