Ejemplo n.º 1
0
        public void TitleSearchWithNoResult()
        {
            var title      = "Warehouse 13121212121212";
            var omdb       = new OmdbQuery();
            var result     = omdb.SearchSingleResult(title);
            var foundTitle = string.IsNullOrEmpty(result.Title) ? false : true;

            Assert.IsFalse(foundTitle);
        }
Ejemplo n.º 2
0
        public void WebhookResponseWithResultAttachments()
        {
            var searchTerm   = "The 100";
            var userName     = "******";
            var responseText = string.Format("Psssst @{0} I couldn't find a title named \"{1}\".", userName, searchTerm);
            var omdbSearch   = new OmdbQuery();
            var searchResult = omdbSearch.SearchSingleResult(searchTerm);
            var imdbId       = searchResult.imdbId;
            var response     = new Model.SlackWebhookResponse().FromOmdbTitleAsAttachment(searchResult);
            var hasImdbId    = response.payload.attachments[0].pretext.Contains(imdbId);

            Assert.IsTrue(hasImdbId);
        }