Beispiel #1
0
        public void CheckOnExceptions()
        {
            SearchServiceMock mock = new SearchServiceMock();
            var service            = new SearchServiceRealizer(mock.data);

            Assert.Throws <ArgumentException>(() => service.GetSearchResult(string.Empty));
            Assert.Throws <ArgumentNullException>(() => service.GetSearchResult(null));
        }
Beispiel #2
0
        public void CheckOnPositiveResults()
        {
            IEnumerable <SearchResult> data = FakeData();
            var service = new SearchServiceRealizer(data);
            var result  = service.GetSearchResult(Guid.NewGuid().ToString());
            var result2 = service.GetSearchResult("ку");

            Assert.Empty(result);
            Assert.NotEmpty(result2);
        }