-
-
Save distributedlife/7445926 to your computer and use it in GitHub Desktop.
distributedlife.com old blog post code snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Result Validation | |
| { | |
| ExtractResult () ; | |
| CheckResultCountEquals (1) ; | |
| CheckAwesomePersonAgainstServiceResponse | |
| ( | |
| lr_get ("{Result_AwesomePerson_1_Id}"), | |
| lr_get ("{Result_AwesomePerson_1_Name}"), | |
| lr_get ("{Result_AwesomePerson_1_Address}"), | |
| lr_get ("{Result_AwesomePerson_1_MobileNumber}") | |
| ) ; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SetDefaultParameters () ; | |
| FaultExpected () ; | |
| CallService () ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SetDefaultParameters () ; | |
| CallService () ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void SetDefaultParameters (void) | |
| { | |
| lr_set ("SoapResult", "ServiceFaultState") ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void FaultExpected (void) | |
| { | |
| lr_save_string ("SoapFault", "ServiceFaultState") ; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "ExpectedResponse=SoapFault", | |
| "ExpectedResponse=SoapResult", | |
| "ExpectedResponse=AnySoap", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "ExpectedResponse={ServiceFaultState}", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| web_service_call | |
| ( | |
| "StepName={Service}::{Method}", | |
| "SOAPMethod={Service}|{Binding}|{Method}", | |
| "ResponseParam=response", | |
| "Service={Service}", | |
| "ExpectedResponse={ServiceFaultState}", | |
| BEGIN_ARGUMENTS, | |
| END_ARGUMENTS, | |
| BEGIN_RESULT, | |
| END_RESULT, | |
| LAST | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void CheckAwesomePerson | |
| ( | |
| const char* const Id, | |
| const char* const Name, | |
| const char* const Address, | |
| const char* const MobileNumber | |
| ) | |
| { | |
| lr_set (Id, "__CheckAwesomePerson_Id") ; | |
| GetRow ("AWESOME_PEOPLE", "ID", lr_get ("{__CheckAwesomePerson_Id}"), "__CheckAwesomePerson") ; | |
| VerifyRowValueEquals ("__CheckAwesomePerson", "ID", Id) ; | |
| VerifyRowValueEquals ("__CheckAwesomePerson", "FOLDER_NAME", Name) ; | |
| VerifyRowValueEquals ("__CheckAwesomePerson", "PARENT_ID", Address) ; | |
| VerifyRowValueEquals ("__CheckAwesomePerson", "FOLDER_TYPE", MobileNumber) ; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SetDefaultParameters () ; | |
| FaultExpected () ; | |
| CallService () ; | |
| ExpectFaultWithCode ("ServiceEpicFailFault") ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ExpectServiceFaultWithCode ("ServiceEpicFailFault") ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ExpectFaultWithCode (“ServiceFault”, "ServiceEpicFailFault") ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void ExpectGenericFault (void) | |
| { | |
| int result = 0 ; | |
| result = lr_xml_extract | |
| ( | |
| "XML={response}", | |
| "FastQuery=Envelope/Body/Fault", | |
| "XMLFragmentParam=Fault", | |
| "NotFound=Continue", | |
| LAST | |
| ); | |
| if (!result) | |
| { | |
| lr_error_message("A generic fault was expected and not found") ; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void ExpectGenericFault (const char* const FaultCode) | |
| { | |
| //... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| success = lr_xml_find | |
| ( | |
| "XML={source}", | |
| "FastQuery={xpath}", | |
| "Value={value}", | |
| "NotFound=Continue", | |
| LAST | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| success = lr_xml_find | |
| ( | |
| "XML={source}", | |
| "Query={xpath}", | |
| "Value={value}", | |
| "NotFound=continue", | |
| "SelectAll=yes", | |
| LAST | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment