public void APIKeyModelInitialized() { _checker = new APIKeysFileExistingChecker(Environment.CurrentDirectory); if (!_checker.IsAPIKeysFileExists) { _checker.CreateKeysConfingFile(); } _apiKeyModel = new APIKeysRepository(_checker.ConfigFilePath); }
public void CheckCreatingKeyConfigFileIfExists() { string path = Environment.CurrentDirectory; APIKeysFileExistingChecker existingModel = new APIKeysFileExistingChecker(path); if (existingModel.IsAPIKeysFileExists) { Assert.AreEqual(path + "\\APIKeys.xml", existingModel.ConfigFilePath); } }
public void CheckCreatingKeyConfigFileIfNotExists() { string path = Environment.CurrentDirectory; APIKeysFileExistingChecker existingModel = new APIKeysFileExistingChecker(path); if (!existingModel.IsAPIKeysFileExists) { bool result = existingModel.CreateKeysConfingFile(); Assert.AreEqual(path + "\\APIKeys.xml", existingModel.ConfigFilePath); File.Delete(path + "\\APIKeys.xml"); } }
public ApiKeyController(IKeysView view) { APIKeysFileExistingChecker checker = new APIKeysFileExistingChecker(Environment.CurrentDirectory); if (!checker.IsAPIKeysFileExists) { checker.CreateKeysConfingFile(); } _view = view; _view.SetInputHandler(this); _keysRepository = new APIKeysRepository(checker.ConfigFilePath); CurrentKey = _keysRepository.FindCurrentAPIKey(); _view.ShowCurrentKey(CurrentKey); _view.ShowAvailableKeys <APIKeyEntity>(_keysRepository.ReadAPIKeys()); }
public void Initialize() { _checker = new APIKeysFileExistingChecker(Environment.CurrentDirectory); _view = new EmptyView(); _controller = new ApiKeyController(_view); }