implement feature to generate random test data
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-11 16:14:00 +11:00
parent aa65b1e784
commit 2afdacaa78
11 changed files with 500 additions and 15 deletions

View File

@@ -128,12 +128,14 @@ func RunTest(testCase *TestCase) error {
// If we found one, add the appropriate replacement to captureValues
for i := range testDefinitions.CaptureCases {
if testDefinitions.CaptureCases[i].TestCaseName == testCase.Name {
fmt.Printf("\nProcessing capture(s) for test case '%s'\n", testCase.Name)
captureData := testDefinitions.CaptureCases[i].CaptureData
for k, v := range captureData.Body.Data {
//fmt.Printf("Body capture %s = %s\n", k, v)
if val, ok := testCase.ResultBodyMap[k]; ok {
fmt.Printf("Found capture %s\n", k)
// TODO handle values other than string using a switch
//fmt.Printf("Found matching capture in body with value : '%v', storing replacement with key '%s'\n", val, v)
captureValues.Data[v] = val.(string)