Last active
September 23, 2016 10:07
-
-
Save Kiran0007Patil/ae70de9d20231798f23f101c70366ca7 to your computer and use it in GitHub Desktop.
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
| //Inside user_test.go | |
| func DisplayTestCaseResults(functionalityName string, tests []TestStruct, t *testing.T) { | |
| for _, test := range tests { | |
| if test.observedStatusCode == test.expectedStatusCode { | |
| t.Logf("Passed Case:\n request body : %s \n expectedStatus : %d \n responseBody : %s \n observedStatusCode : %d \n", test.requestBody, test.expectedStatusCode, test.responseBody, test.observedStatusCode) | |
| } else { | |
| t.Errorf("Failed Case:\n request body : %s \n expectedStatus : %d \n responseBody : %s \n observedStatusCode : %d \n", test.requestBody, test.expectedStatusCode, test.responseBody, test.observedStatusCode) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment