public ApplicationTaskLogic(IOptions <AppSettings> conf, IDictionaryLogic dictionarylogic, IUserLogic userLogic, IBaseLogic baseLogic)
 {
     _conf            = conf;
     _dictionarylogic = dictionarylogic;
     _userLogic       = userLogic;
     _baseLogic       = baseLogic;
 }
Exemple #2
0
 public ApplicationLogic(IDictionaryLogic dictionarylogic, IUserLogic userLogic, IApplicationWorkflowLogic applicationWorkflowLogic, IBaseLogic baseLogic)
 {
     _dictionarylogic          = dictionarylogic;
     _userLogic                = userLogic;
     _applicationWorkflowLogic = applicationWorkflowLogic;
     _baseLogic                = baseLogic;
 }
Exemple #3
0
        public void InsertsDoubleWordNotFound(string word)
        {
            List <string> inputDictionary = new List <string>()
            {
                "spain", "plaint", "paint"
            };

            _dictionaryLogic  = new DictionaryLogic(inputDictionary, _alphabetUS);
            _correctionsLogic = new CorrectionsLogic(_dictionaryLogic, _formatStrings);

            string testString = _correctionsLogic.Correct(word);

            Assert.That(testString, Is.EqualTo("{" + word + "?}"));
        }
Exemple #4
0
        public void ReturnAnUnknownWord(string wordUnknown)
        {
            List <string> inputDictionary = new List <string>()
            {
                "rain", "spain", "plain", "plaint", "pain", "main", "mainly", "the", "in", "on", "fall", "falls", "his", "was"
            };

            _dictionaryLogic  = new DictionaryLogic(inputDictionary, _alphabetUS);
            _correctionsLogic = new CorrectionsLogic(_dictionaryLogic, _formatStrings);

            string testString = _correctionsLogic.Correct(wordUnknown);

            Assert.AreEqual("{" + wordUnknown + "?}", testString);
        }
Exemple #5
0
        public void ReturnAnSomeWords()
        {
            List <string> inputDictionary = new List <string>()
            {
                "spain", "plaint", "paint"
            };
            string word = "ptain";

            _dictionaryLogic  = new DictionaryLogic(inputDictionary, _alphabetUS);
            _correctionsLogic = new CorrectionsLogic(_dictionaryLogic, _formatStrings);

            string testString = _correctionsLogic.Correct(word);

            Assert.AreEqual("{spain paint}", testString);
        }
Exemple #6
0
        public void OutputTrueString()
        {
            List <string> inputDictionary = new List <string>()
            {
                "rain", "spain", "plain", "plaint", "pain", "main", "mainly", "the", "in", "on", "fall", "falls", "his", "was"
            };
            List <string> wordsArrayList = new List <string>()
            {
                "hte", "rame", "in", "pain", "fells", "mainy", "oon", "teh", "lain", "was", "hints", "pliant"
            };

            _dictionaryLogic  = new DictionaryLogic(inputDictionary, _alphabetUS);
            _correctionsLogic = new CorrectionsLogic(_dictionaryLogic, _formatStrings);

            string output = "";

            foreach (string s in wordsArrayList)
            {
                output += _correctionsLogic.Correct(s) + " ";
            }

            Assert.That(output.Trim(' '), Is.EqualTo("the {rame?} in pain falls {main mainly} on the plain was {hints?} plaint"));
        }
 public DictionaryController(IDictionaryLogic logic)
 {
     _logic = logic;
 }
Exemple #8
0
 public CorrectionsLogic(IDictionaryLogic dictionaryLogic, IFormatStrings formatStrings)
 {
     _dictionaryLogic = dictionaryLogic;
     _formatStrings   = formatStrings;
 }