public void SearchForSummaryReturnsMatchingEntries() { // Arrange var searcher = new EntrySearcher(ProjectListVm); // Act searcher.Text = "test"; // Assert Assert.AreEqual(1, searcher.Matches.Count); Assert.AreSame(Todos[0], searcher.Matches.First().Model); }
public void IsSearchingPropertyIsCorrectlySet() { // Arrange var projectListMock = new Mock <IProjectListViewModel>(); var searcher = new EntrySearcher(projectListMock.Object); // Act searcher.Text = string.Empty; bool empty = searcher.IsSearching; searcher.Text = "test"; bool nonEmpty = searcher.IsSearching; // Assert Assert.IsFalse(empty); Assert.IsTrue(nonEmpty); }
public void CurrentProjectIsChangedOnMessage() { // Arrange var messenger = new Messenger(); var projectListMock = new Mock <IProjectListViewModel>(); projectListMock.SetupGet(x => x.CurrentProject).Verifiable(); var searcher = new EntrySearcher(projectListMock.Object, messenger); // Act messenger.Send(new CurrentProjectChangedMessage(null)); // Assert projectListMock.VerifyGet(x => x.CurrentProject, Times.Exactly(2)); }