示例#1
0
        public async Task FindPagesCreatedBy_should_find_pages_created_by_with_case_insensitive_search()
        {
            // given
            PageRepository repository = CreateRepository();

            CreateTenPages(repository);             // add random data

            var page1 = _fixture.Create <Page>();
            var page2 = _fixture.Create <Page>();

            page1.CreatedBy = "myself";
            page2.CreatedBy = "MYSELf";

            await repository.AddNewPageAsync(page1);

            await repository.AddNewPageAsync(page2);

            // when
            IEnumerable <Page> actualPages = await repository.FindPagesCreatedByAsync("myself");

            // then
            actualPages.Count().ShouldBe(2);
            actualPages.First(x => x.Id == page1.Id).ShouldNotBeNull();
            actualPages.First(x => x.Id == page2.Id).ShouldNotBeNull();
        }