コード例 #1
0
        public void TestBandsQuery()
        {
            var reqParams = new TasteKidRequestParams();

            reqParams.AddBandQuery("the beatles");
            var resp = TasteKidRequest.Search(reqParams);

            Assert.IsNotNull(resp);
            Assert.IsNotNull(resp.Similar.Info.FirstOrDefault(ii => ii.Name == "The Beatles" && ii.Type == "music"));
            Assert.IsNotNull(resp.Similar.Results.FirstOrDefault(rr => rr.Name == "The Rolling Stones" && rr.Type == "music"));
            Assert.IsNotNull(resp.Similar.Results.FirstOrDefault(rr => rr.Name == "A Hard Day's Night" && rr.Type == "movie"));
        }
コード例 #2
0
        public void TestQueryWithAppIdentification()
        {
            var reqParams = new TasteKidRequestParams();

            reqParams.AddBandQuery("the beatles");
            /// put here your app ID data here, don't wont to share mine with the world :)
            reqParams.K_Param = "";
            reqParams.F_Param = "";
            var resp = TasteKidRequest.Search(reqParams);

            Assert.IsNotNull(resp);
            Assert.IsNotNull(resp.Similar.Info.FirstOrDefault(ii => ii.Name == "The Beatles" && ii.Type == "music"));
            Assert.IsNotNull(resp.Similar.Results.FirstOrDefault(rr => rr.Name == "The Rolling Stones" && rr.Type == "music"));
            Assert.IsNotNull(resp.Similar.Results.FirstOrDefault(rr => rr.Name == "A Hard Day's Night" && rr.Type == "movie"));
        }
コード例 #3
0
        public void TestQueryItems()
        {
            var reqParams = new TasteKidRequestParams();

            reqParams.AddQuery("daft punk");
            reqParams.AddQuery("pulp fiction");
            var resp = TasteKidRequest.Search(reqParams);

            Assert.IsNotNull(resp);
            Assert.IsNotNull(resp.Similar.Info.FirstOrDefault(ii => ii.Name == "Daft Punk" && ii.Type == "music"));
            Assert.IsNotNull(resp.Similar.Info.FirstOrDefault(ii => ii.Name == "Pulp Fiction" && ii.Type == "movie"));
            Assert.IsNotNull(resp.Similar.Results.FirstOrDefault(rr => rr.Name == "Justice" && rr.Type == "music"));
            Assert.IsNotNull(resp.Similar.Results.FirstOrDefault(rr => rr.Name == "The Chemical Brothers" && rr.Type == "music"));
            Assert.IsNotNull(resp.Similar.Results.FirstOrDefault(rr => rr.Name == "Jackie Brown" && rr.Type == "movie"));
        }