Exemplo n.º 1
0
 public WordLadderApp(IFileManager fileManager, IWordLadderSolver solver, IOptions <ApplicationArguments> options)
 {
     _wordList         = new();
     _wordLadderSolver = solver;
     fileManager.TryLoadDictionaryFile(options.Value.DictionaryFileName, ref _wordList);
     _wordList = SanitiseWordList(_wordList);
 }
 public WordLadderApp(IInputValidator inputValidator, IWordDictionaryService wordDictionaryService,
                      IWordLadderSolver wordladderSolver, IOpenFileHelper openFileHelper, IFileWrapper fileWrapper)
 {
     _inputValidator        = inputValidator;
     _wordDictionaryService = wordDictionaryService;
     _wordladderSolver      = wordladderSolver;
     _openFileHelper        = openFileHelper;
     _fileWrapper           = fileWrapper;
 }
        public WordLadderAppTests()
        {
            _inputValidator        = Substitute.For <IInputValidator>();
            _wordDictionaryService = Substitute.For <IWordDictionaryService>();
            _wordLadderSolver      = Substitute.For <IWordLadderSolver>();
            _openFileHelper        = Substitute.For <IOpenFileHelper>();
            _fileWrapper           = Substitute.For <IFileWrapper>();

            _sut = new WordLadderApp(_inputValidator, _wordDictionaryService, _wordLadderSolver, _openFileHelper,
                                     _fileWrapper);
        }
Exemplo n.º 4
0
        public CalculateWordLadderTests()
        {
            var fileManagerLogger = Substitute.For <ILogger <FileManager> >();

            _fileManager      = new FileManager(fileManagerLogger);
            _wordLadderSolver = Substitute.For <IWordLadderSolver>();
            _options          = Options.Create(new ApplicationArguments
            {
                DictionaryFileName = "test.txt",
                StartWord          = "spin",
                EndWord            = "spot",
                ResultsFileName    = "testresults.txt"
            });
        }
 public WordLadderSolverTests()
 {
     _getWordFromProcessedListService = Substitute.For <IGetSimilarWordsFromProcessedListService>();
     _sut = new WordLadderSolver(_getWordFromProcessedListService);
     _getWordFromProcessedListService.ClearReceivedCalls();
 }
Exemplo n.º 6
0
 public IntegrationTests()
 {
     _sut = new WordLadderSolver(new GetSimilarWordsFromProcessedListService());
 }