コード例 #1
0
ファイル: CatsTesting.cs プロジェクト: Soyvolon/Shatter
        public async Task CatArgumentsTest()
        {
            var res = await Cats.GetCatDataAsync();

            Assert.NotNull(res);

            res = await Cats.GetCatDataAsync("desc");

            Assert.NotNull(res);
            Assert.NotZero(res.Length, "Missing Cat item");

            res = await Cats.GetCatDataAsync("random", "gif");

            Assert.NotNull(res);
            Assert.NotZero(res.Length, "Missing Cat item");
            Assert.True(Path.GetExtension(res[0].Url).Contains("gif"), "File type incorrect");

            res = await Cats.GetCatDataAsync("gif", "jpg", "random");

            Assert.NotNull(res);
            Assert.NotZero(res.Length, "Missing Cat item");
            Assert.True(Path.GetExtension(res[0].Url).Contains("jpg") ||
                        Path.GetExtension(res[0].Url).Contains("gif"), "File type incorrect.");

            res = await Cats.GetCatDataAsync("foo", "bar");

            Assert.NotNull(res);
            Assert.NotZero(res.Length, "Missing Cat item");
        }