Example #1
0
        public void AutocompleteTestInit()
        {
            CreatedWordsManager.ClearCreated();

            var r = new SuggestionsMaker(session, AuthorityController.CurrentDoctor);

            a = new HrEditorAutocomplete(r);
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="qe"></param>
        /// <param name="title">Текст, которого нет в БД</param>
        /// <returns></returns>
        public static Word CompleteWord(this AutocompleteViewModel auto, string title)
        {
            Contract.Ensures(Contract.Result <Word>().IsTransient);

            var tag = auto.LastTag;

            auto.SelectedTag = tag;
            tag.Query        = title;
            auto.CompleteOnEnter(tag, inverse: true);
            return(tag.Blank as Word);
        }
Example #3
0
        public void AutocompleteTestInit()
        {
            CreatedWordsManager.ClearCreated();

            r     = new SuggestionsMaker(session, AuthorityController.CurrentDoctor);
            a     = new HrEditorAutocomplete(r);
            word  = session.Get <Word>(IntToGuid <Word>(1));
            icd1  = session.Get <IcdDisease>(1);
            q     = word.Title.Substring(0, word.Title.Length - 1);
            qFull = word.Title;

            a.SelectedTag = a.Tags.Last();
        }
        public void ResultModelToAutocompleteViewModel()
        {
            //Arrange
            SchoolResult result = MockData.GetSchoolResult(true);

            //Act
            AutocompleteViewModel autoCompleteViewModel = result;

            //Assert

            //Checks the Schoolresult object gets converted to AutocompleteViewModel
            Assert.IsNotNull(autoCompleteViewModel);

            //Checks the School name in the school model is included
            //when converting from SchoolResult to AutocompleteViewModel
            Assert.AreEqual(result.School.SCHNAME, autoCompleteViewModel.SCHNAME);
        }