Пример #1
0
        public void WhenTagIsAddedThenProjectCanBeRetrieved()
        {
            // Given
            var tagId         = Guid.NewGuid();
            var addTagCommand = new AddTagCommand
            {
                TagId    = tagId,
                TagName  = "TestProject",
                TagNotes = "Here be dragons",
            };

            // When
            Commander.Send(addTagCommand);

            // Then l
            var findTagsByIdsQuery = new FindTagsByIdsQuery
            {
                TagIds = new List <Guid> {
                    tagId
                },
            };
            var result = Querier
                         .Search(findTagsByIdsQuery)
                         .Tags.Single();

            Assert.That(result.TagId, Is.EqualTo(tagId));
        }
Пример #2
0
        private bool OpenSearchPage()
        {
            if ((!TxtSearch.Text.Equals("")) && Querier.Search(TxtSearch.Text).Count > 0)
            {
                Searchpage.SearchTxt = TxtSearch.Text;
                Searchpage.BringToFront();

                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #3
0
        private void Search()
        {
            ResultsWindow.Controls.Clear();
            Pages.Controls.Clear();
            sw.Start();
            searchTerm       = TxtSearch1.Text;
            searchresultlist = Querier.Search(TxtSearch1.Text);
            searchresults    = DivideIntoPages(searchresultlist);
            SearchTime.Text  = ((double)sw.ElapsedMilliseconds) + "ms";
            sw.Reset();
            DisplayPages(0);
            currentPage = 0;
            StoreSearch.Stop();

            StoreSearch.Start();
        }
        public void ShouldReturnActivitiesWhenActivitiesAreSearchedByDate()
        {
            // Given
            var query = new FindActivitiesByDateQuery()
            {
                TenantId = JohnDoeStory.UserId,
                Date     = JohnDoeStory.Date,
            };

            // When
            var result = Querier.Search(query);

            // Then
            Assert.That(result, Is.Not.Null);
            Assert.That(result.Activities, Is.Not.Null);
            Assert.That(result.Activities.Any(), Is.True);
            result.Activities.Dump();
        }
Пример #5
0
        public void WhenTagIsAddedTwiceThenProjectIsNotDuplicated()
        {
            // Given
            var tagId        = Guid.NewGuid();
            var firstCommand = new AddTagCommand
            {
                TagId    = tagId,
                TagName  = "TestProject",
                TagNotes = "Here be dragons",
            };

            // When
            var secondCommand = firstCommand.Clone();
            var commands      = new List <ICommand>
            {
                firstCommand,
                secondCommand,
            };

            Commander.Send(commands);

            // Then
            var findTagsByIdsQuery = new FindTagsByIdsQuery
            {
                TagIds = new List <Guid>
                {
                    firstCommand.TagId,
                    secondCommand.TagId,
                }
            };
            var result = Querier.Search(findTagsByIdsQuery);

            Assert.That(result, Is.Not.Null);
            Assert.That(result.Tags, Is.Not.Null);
            Assert.That(result.Tags.Count, Is.EqualTo(1));
        }