Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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));
        }