Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }