public void PhotoSearchVmInstaceTest()
        {
            var flickrFeedPhotoSearchService = new FlickrPublicFeedSearchService();
            var twitterSearchService         = new TwitterSearchService();
            var instance = new PhotoSearchViewModel(flickrFeedPhotoSearchService, twitterSearchService);

            Assert.IsNotNull(instance);
        }
Beispiel #2
0
        public void FlickrSearchTest()
        {
            var twitterSearchService = new TwitterSearchService();

            twitterSearchService.SearchString = "nature";
            var result = twitterSearchService.ExecuteSearch();

            Assert.IsNotNull(twitterSearchService);
        }
        public void PhotoSearchVmInvalidSearchTest()
        {
            var flickrFeedPhotoSearchService = new FlickrPublicFeedSearchService();
            var twitterSearchService         = new TwitterSearchService();
            var instance = new PhotoSearchViewModel(flickrFeedPhotoSearchService, twitterSearchService);

            instance.SearchString = "skhfakjshfk"; //some random string that cannot be found in our regular use.
            instance.SearchCommand.Execute(null);
            Assert.IsNotNull(instance);
            Assert.AreSame(instance.SearchLabel, "Search results are Empty. Perform Search to view Photos here.");
        }
        public void PhotoSearchVmEmptySearchTest()
        {
            var flickrFeedPhotoSearchService = new FlickrPublicFeedSearchService();
            var twitterSearchService         = new TwitterSearchService();
            var instance = new PhotoSearchViewModel(flickrFeedPhotoSearchService, twitterSearchService);

            instance.SearchString = string.Empty;
            instance.SearchCommand.Execute(null);
            Assert.IsNotNull(instance);
            Assert.AreSame(instance.SearchLabel, "Search String cannot be Empty. Please try again!!");
        }
        public void PhotoSearchVmValidSearchTest()
        {
            Exception exception = null;

            try
            {
                var flickrFeedPhotoSearchService = new FlickrPublicFeedSearchService();
                var twitterSearchService         = new TwitterSearchService();
                var instance = new PhotoSearchViewModel(flickrFeedPhotoSearchService, twitterSearchService);
                instance.SearchString = "nature"; //some random string that cannot be found in our regular use.
                instance.SearchCommand.Execute(null);
                Assert.IsNotNull(instance);
            }
            catch (Exception ex)
            {
                exception = ex;
            }

            Assert.IsNull(exception);
        }
Beispiel #6
0
        public void TwitterSearchInstanceTest()
        {
            var twitterSearchService = new TwitterSearchService();

            Assert.IsNotNull(twitterSearchService);
        }
Beispiel #7
0
        public ActionResult Users(string name)
        {
            TwitterSearchService service = new TwitterSearchService();

            return(View(service.SearchUsers(name)));
        }