Пример #1
0
        public void CountOfWordsMustBeDecreaseOnOneWhenCallMethodDeleteWord()
        {
            var model = new ListOfWordsViewModel(null, null, null);

            model.Words.Add(new WordViewModel()
            {
                Name = "name", Translate = "translate",
            });
            model.Words.Add(new WordViewModel()
            {
                Name = "name2", Translate = "translate2",
            });
            model.Words.Add(new WordViewModel()
            {
                Name = "name3", Translate = "translate3",
            });
            model.SelectedWord = model.Words[1];
            model.TotalCount   = model.Words.Count;
            int oldCount = model.Words.Count;

            model.DeleteWord();

            Assert.AreEqual(model.Words.Count, oldCount - 1);
            Assert.AreEqual(model.Words.Count, model.TotalCount);
        }
Пример #2
0
        public void TheWordMustBeRemovedFromWordListWhenCallMethodDeleteWord()
        {
            var model = new ListOfWordsViewModel(null, null, null);

            model.Words.Add(new WordViewModel()
            {
                Name = "name", Translate = "translate",
            });
            model.Words.Add(new WordViewModel()
            {
                Name = "name2", Translate = "translate2",
            });
            model.Words.Add(new WordViewModel()
            {
                Name = "name3", Translate = "translate3",
            });
            model.SelectedWord = model.Words[1];
            model.TotalCount   = model.Words.Count;
            model.DeleteWord();

            Assert.IsFalse(model.Words.Contains(model.SelectedWord));
        }
Пример #3
0
 public ListOfWords(Theme theme)
 {
     InitializeComponent();
     ViewModel   = new ListOfWordsViewModel(theme);
     DataContext = ViewModel;
 }
Пример #4
0
 public ListOfWords(string nameMethod, string namePage, string nameTrainPage)
 {
     InitializeComponent();
     ViewModel   = new ListOfWordsViewModel(nameMethod, namePage, nameTrainPage);
     DataContext = ViewModel;
 }