Exemplo n.º 1
0
        public void CanUseWapiToViewIdCard()
        {
            var ctx = UnitTestContext.Get(EnvironmentHelper.GetEnvironment(),
                                          "*****@*****.**");

            dynamic memberUrlsResult = ApiUtil.GetJsonResult <dynamic>(ctx, "Animation/Card/CardUrls/en");

            Assert.IsNotNull(memberUrlsResult);

            Assert.IsNotNull(memberUrlsResult.Results);
            List <CardResult> cardResults = memberUrlsResult.Results.ToObject <List <CardResult> >();

            var authResult = ctx.GetAuthResult();

            cardResults.ForEach(r => {
                Debug.WriteLine(r.CardUrl);
                var result = ApiUtil.GetContentResult(ctx, r.CardUrl, false, string.Empty, authResult);

                Assert.IsFalse(string.IsNullOrEmpty(result));
                Assert.IsFalse(result.Contains("Something went wrong"));
            });
        }