public void CanGetConfigurationValues() { var ctx = UnitTestContext.Get(EnvironmentHelper.GetEnvironment(), "*****@*****.**"); var urlResults = ApiUtil.GetJsonResult <dynamic>(ctx, String.Format("Animation/Settings/GetConfigurationValues/{0}/{1}", ctx.Employer.Id, ctx.Employer.HandshakeId)); Assert.IsNotNull(urlResults.Security); }
public void CanGetConfigurationValue() { var ctx = UnitTestContext.Get(EnvironmentHelper.GetEnvironment(), "*****@*****.**"); var urlResults = ApiUtil.GetJsonResult <dynamic>(ctx, String.Format("Animation/Settings/{0}/{1}/ConfigValue/?configKey=NetworkLatencyThresholdJson", ctx.Employer.HandshakeId, ctx.Employer.Id)); Assert.IsNotNull(urlResults.Results.Id); }
public void CanGetMobilePhone() { foreach (var testUser in TestAccounts.Accounts) { var ctx = UnitTestContext.Get(EnvironmentHelper.GetEnvironment(), testUser.Username); var result = ApiUtil.GetJsonResult <dynamic>(ctx, "Animation/Membership/Phone/Mobile"); Assert.IsNotNull(result); } }
public void CanGetIdCardsE2E() { if (!Debugger.IsAttached) { return; } var ctx = UnitTestContext.Get(Environment.LocalWapi, "*****@*****.**"); var result = ApiUtil.GetJsonResult <ApiResult <List <IdCard.Data.IdCard> > >(ctx, @"v2/IdCards"); Assert.IsNotNull(result); }
public void CanGetMediaUrl() { var ctx = UnitTestContext.Get(EnvironmentHelper.GetEnvironment(), "*****@*****.**"); // This needs to be made dynamic somehow. Also, the api returns a string even if // there's no matching record in the database. The api should be updated to return a // 404 if there's no matching database record. var results = ApiUtil.GetJsonResult <dynamic>(ctx, String.Format("Animation/Media/MediaUrl/{0}", "14.38")); Assert.IsNotNull(results); }
public void CanGetPushPromptStatus() { var ctx = UnitTestContext.Get(EnvironmentHelper.GetEnvironment(), "*****@*****.**"); var result = ApiUtil.GetJsonResult <dynamic>(ctx, String.Format("Animation/Messaging/PushPrompt/{0}/{1}/{2}", ctx.Employer.Id, ctx.Employer.HandshakeId, "96dcba2ce8e6a7d7ce57e05a75cf2902d721b47457fa64662ca2ae46e4ca9bce" )); Assert.IsNotNull(result); Assert.IsNotNull(result.PromptStatus); }
public void CanGetPlanInfoFromWapi() { SqlMapper.SetTypeMap(typeof(HealthPlanSummary), new ColumnAttributeTypeMapper <HealthPlanSummary>()); var ctx = UnitTestContext.Get(EnvironmentHelper.GetEnvironment(), "*****@*****.**"); var summary = ApiUtil.GetJsonResult <HealthPlanSummary>(ctx, "Animation/HealthPlanSummary"); Assert.IsNotNull(summary); Assert.IsFalse(string.IsNullOrEmpty(summary.PlanName)); Assert.AreNotEqual(0, summary.Deductible); Assert.IsFalse(summary.AsOfDate.HasValue); Assert.IsFalse(summary.YearToDateSpent.HasValue); Assert.AreNotEqual(0, summary.Deductible); Assert.IsTrue(!summary.Coinsurance.HasValue || !summary.Coinsurance.Value.Equals(0)); Assert.AreNotEqual(0, summary.CoinsuranceComplement); Assert.IsTrue(!summary.Copay.HasValue || !summary.Copay.Value.Equals(0)); Assert.AreNotEqual(0, summary.OutOfPocketMax); }
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")); }); }
public void CanUseWapiToEmailIdCard() { var ctx = UnitTestContext.Get(EnvironmentHelper.GetEnvironment(), "*****@*****.**"); var memberUrlsResult = ApiUtil.GetJsonResult <dynamic>(ctx, "Animation/Card/CardUrls/en"); Assert.IsNotNull(memberUrlsResult); var cardWebRequest = new MemberCardWebRequest() { CardToken = memberUrlsResult.Results[0].SecurityToken, ToEmail = "*****@*****.**", Subject = "CanEmailIdCard Unit Test", Message = "Unit test result" }; var emailResult = ApiUtil.PostJson <MemberCardWebRequest>(ctx, "Animation/Card/Email", cardWebRequest); Assert.IsNotNull(emailResult); Assert.AreEqual(HttpStatusCode.OK, emailResult.Item1); //var cardController = new CardController(); //dynamic memberUrlsResult = cardController.GetMemberCardUrls("", TestAccounts.CaesarsAccounts.MarySmith.CchId); //Assert.IsNotNull(memberUrlsResult); //var cardWebRequest = new MemberCardWebRequest() { // CardToken = memberUrlsResult.Results[0].SecurityToken, // ToEmail = "*****@*****.**", // Subject = "CanEmailIdCard Unit Test", // Message = "Unit test result" //}; //var emailResult = cardController.SendIdCardEmail(cardWebRequest); //Assert.IsNotNull(emailResult); }