Exemplo n.º 1
0
        public void WordsAfterRename()
        {
            // save word
            crit.Open(cr[3]);
            var auto = (crit.CurrentEditor as CriterionEditorViewModel).QueryEditor.QueryBlocks[0].AutocompleteAll as AutocompleteViewModel;
            var w    = new Word("11");

            auto.SelectedTag = auto.AddTag(w);
            crit.CurrentEditor.OkCommand.Execute(null);

            // rename
            using (var e = new WordEditorViewModel(w))
            {
                w.Title = "2";
                e.OkCommand.Execute(null);
            }

            // word still in crit
            crit.Open(cr[3]);
            auto = (crit.CurrentEditor as CriterionEditorViewModel).QueryEditor.QueryBlocks[0].AutocompleteAll as AutocompleteViewModel;
            var word = auto.GetCHIOs().ElementAt(0).HIO as Word;

            Assert.AreEqual(w, word);
            Assert.AreEqual("2", word.Title);
        }
Exemplo n.º 2
0
        public void WordWithUomTitleAfterRename()
        {
            Load <Uom>();


            // save
            crit.Open(cr[3]);
            var auto = (crit.CurrentEditor as CriterionEditorViewModel).QueryEditor.QueryBlocks[0].AutocompleteAll as AutocompleteViewModel;
            var w    = new Word(uom[1].Type.Title);
            var m    = new MeasureOp(MeasureOperator.Equal, 1, uom[1], w);

            auto.SelectedTag = auto.AddTag(m);
            crit.CurrentEditor.OkCommand.Execute(null);

            // rename
            using (var e = new WordEditorViewModel(w))
            {
                w.Title = "2";
                e.OkCommand.Execute(null);
            }

            // word still in crit
            crit.Open(cr[3]);
            auto = (crit.CurrentEditor as CriterionEditorViewModel).QueryEditor.QueryBlocks[0].AutocompleteAll as AutocompleteViewModel;
            var word = (auto.GetCHIOs().ElementAt(0).HIO as Measure).Word;

            Assert.AreEqual(w, word);
            Assert.AreEqual("2", word.Title);
        }
Exemplo n.º 3
0
        public void CanNotAddWordInOtherCase()
        {
            var newW = new Word(w[1].Title.ToUpper());

            using (var wEditor = new WordEditorViewModel(newW))
            {
                Assert.IsFalse(wEditor.OkCommand.CanExecute(null));
            }
        }