public void FindCommand_DialogOpen_NotOpenedAgain() { using (var env = new WordListsViewModelTestEnvironment()) { SetupProjectWithWords(env); env.OpenFindDialog(); env.DialogService.ClearReceivedCalls(); env.WordListsViewModel.FindCommand.Execute(null); env.DialogService.DidNotReceive().ShowModelessDialog(env.WordListsViewModel, Arg.Any <FindViewModel>(), Arg.Any <Action>()); } }
public void FindCommand_DialogOpen_NotOpenedAgain() { using (var env = new WordListsViewModelTestEnvironment()) { SetupProjectWithWords(env); env.OpenFindDialog(); env.DialogService.ClearReceivedCalls(); env.WordListsViewModel.FindCommand.Execute(null); env.DialogService.DidNotReceive().ShowModelessDialog(env.WordListsViewModel, Arg.Any<FindViewModel>(), Arg.Any<Action>()); } }
public void FindCommand_GlossNothingSelectedNoMatches_NoWordSelected() { using (var env = new WordListsViewModelTestEnvironment()) { SetupProjectWithWords(env); env.OpenFindDialog(); env.FindViewModel.Field = FindField.Gloss; env.FindViewModel.String = "gloss4"; env.FindViewModel.FindNextCommand.Execute(null); Assert.That(env.WordListsViewModel.SelectedVarietyMeaning, Is.Null); } }
public void FindCommand_GlossNothingSelectedMatches_CorrectWordsSelected() { using (var env = new WordListsViewModelTestEnvironment()) { SetupProjectWithWords(env); env.OpenFindDialog(); env.FindViewModel.Field = FindField.Gloss; env.FindViewModel.String = "gloss2"; env.FindViewModel.FindNextCommand.Execute(null); Assert.That(env.WordListsViewModel.SelectedVarietyMeaning, Is.EqualTo(env.WordListsViewModel.Varieties[0].Meanings[1])); env.FindViewModel.FindNextCommand.Execute(null); Assert.That(env.WordListsViewModel.SelectedVarietyMeaning, Is.EqualTo(env.WordListsViewModel.Varieties[0].Meanings[1])); } }
public void FindCommand_FormLastWordSelectedChangeSelectedWord_CorrectWordsSelected() { using (var env = new WordListsViewModelTestEnvironment()) { SetupProjectWithWords(env); env.OpenFindDialog(); env.FindViewModel.Field = FindField.Form; env.WordListsViewModel.SelectedVarietyMeaning = env.WordListsViewModel.Varieties[1].Meanings[2]; env.FindViewModel.String = "ba"; env.FindViewModel.FindNextCommand.Execute(null); Assert.That(env.WordListsViewModel.SelectedVarietyMeaning, Is.EqualTo(env.WordListsViewModel.Varieties[0].Meanings[2])); env.WordListsViewModel.SelectedVarietyMeaning = env.WordListsViewModel.Varieties[0].Meanings[0]; env.FindViewModel.FindNextCommand.Execute(null); Assert.That(env.WordListsViewModel.SelectedVarietyMeaning, Is.EqualTo(env.WordListsViewModel.Varieties[0].Meanings[2])); env.FindViewModel.FindNextCommand.Execute(null); Assert.That(env.WordListsViewModel.SelectedVarietyMeaning, Is.EqualTo(env.WordListsViewModel.Varieties[1].Meanings[2])); env.FindViewModel.FindNextCommand.Execute(null); Assert.That(env.WordListsViewModel.SelectedVarietyMeaning, Is.EqualTo(env.WordListsViewModel.Varieties[1].Meanings[2])); } }