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)); }
private bool OpenSearchPage() { if ((!TxtSearch.Text.Equals("")) && Querier.Search(TxtSearch.Text).Count > 0) { Searchpage.SearchTxt = TxtSearch.Text; Searchpage.BringToFront(); return(true); } else { return(false); } }
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(); }
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)); }