private void InitTestForBindPreview( List <CommEntities.EmailPreview> emailPreviews = null, string previewHtml = "", CodeAnalysisTest codeAnalysisTest = null, List <CodeAnalysisResult> codeAnalysisResults = null, LinkTest linkTest = null, List <TestingApplication> testingApplicationList = null, bool shimEncryption = true) { InitCommonShimForBindPreview(); SetPageControlsForBindPreview(); SetPagePropertiesForBindPreview(); Set(CodeAnalysisResultFieldName, codeAnalysisResults); FakeCommData.ShimEmailPreview.GetListSqlCommand = (cmd) => emailPreviews; FakeCommData.ShimBlast.GetByBlastIDInt32 = (id) => new CommEntities.BlastSMS() { LayoutID = 1 }; ShimLayout.GetPreviewInt32EnumsContentTypeCodeBooleanUserNullableOfInt32NullableOfInt32NullableOfInt32 = (id, type, isMobile, user, emailID, groupID, blastid) => previewHtml; KM.Platform.Fakes.ShimUser.HasAccessUserEnumsServicesEnumsServiceFeaturesEnumsAccess = (user, service, feature, view) => true; ShimAccessCheck.CanAccessByCustomerOf1M0User <CommEntities.BlastAbstract>((blastAbstract, user) => true); ShimAccessCheck.CanAccessByCustomerOf1M0EnumsServicesEnumsServiceFeaturesEnumsAccessUser <CommEntities.BlastFields>((fields, code, feature, access, user) => true); FakeCommData.ShimBlastFields.GetSqlCommand = (command) => CreateBlastFieldsForBindPreview(); ShimPreview.AllInstances.GetCodeAnalysisTestString = (p, html) => codeAnalysisTest; ShimRestClient.AllInstances.ExecuteOf1IRestRequest((client, req) => { var serializedLinkTest = JsonConvert.SerializeObject(linkTest); var response = new RestResponse <LinkTest>(); response.Content = serializedLinkTest; return(response); }); ShimRestClient.AllInstances.ExecuteOf1IRestRequest((client, req) => { var emailTest = new EmailTest(); emailTest.TestingApplications = testingApplicationList; var serializedEmailTest = JsonConvert.SerializeObject(emailTest); var response = new RestResponse <EmailTest>(); response.Content = serializedEmailTest; return(response); }); ShimRestClient.AllInstances.ExecuteOf1IRestRequest((client, req) => { var testingAppList = new List <TestingApplication>(); testingAppList.Add(new TestingApplication() { ApplicationName = "2" }); var serializedTestingAppList = JsonConvert.SerializeObject(testingAppList); var response = new RestResponse <List <TestingApplication> >(); response.Content = serializedTestingAppList; return(response); }); if (shimEncryption) { ShimEncryption.GetCurrentByApplicationIDInt32 = (id) => new Encryption(); } }
private LinkTest CreateLinkTestForBindPreview() { var linkTest = new LinkTest(); var links = new List <Link>(); links.Add(new Link() { IsValid = true }); links.Add(new Link() { IsValid = false }); linkTest.Links = links; return(linkTest); }
/// <summary> /// click on link test icon /// </summary> /// <returns></returns> public void SelectLinkTest() { LinkTest.Wait(2).Click(); }