Exemplo n.º 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);
        }
Exemplo n.º 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));
        }
Exemplo n.º 3
0
 public ListOfWords(Theme theme)
 {
     InitializeComponent();
     ViewModel   = new ListOfWordsViewModel(theme);
     DataContext = ViewModel;
 }
Exemplo n.º 4
0
 public ListOfWords(string nameMethod, string namePage, string nameTrainPage)
 {
     InitializeComponent();
     ViewModel   = new ListOfWordsViewModel(nameMethod, namePage, nameTrainPage);
     DataContext = ViewModel;
 }