예제 #1
0
        public void TestSearchByLimit_10()
        {
            //Given
            SearchRepository searchDataService = new SearchRepository(context);

            //When
            var posts = searchDataService.RankedWeightedSearch(1, 0, 10, "java");

            //Then
            Assert.Equal(10, posts.Count);
        }
예제 #2
0
        public void TestSearchByOffset_10()
        {
            //Given
            SearchRepository searchDataService = new SearchRepository(context);

            //When
            var posts = searchDataService.RankedWeightedSearch(1, 10, 10, "java");

            //Then
            Assert.Equal(57795, posts[0].PostId);
        }
예제 #3
0
        public void TestSearchByID_NotFound()
        {
            //Given
            SearchRepository searchDataService = new SearchRepository(context);

            //When
            var posts = searchDataService.RankedWeightedSearch(-1, 0, 10, "test");

            //Then
            Assert.Null(posts);
        }