Skip to content

Commit

Permalink
remove the struct to be map of string (#83)
Browse files Browse the repository at this point in the history
* remove the struct to be map of string

* example for value
  • Loading branch information
aabughosh authored Mar 20, 2023
1 parent 66b8408 commit 2dbea12
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions pkg/claim/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,6 @@ import (
"strings"
)

/*
{
"ForTelco": "Mandatory",
"FarEdge" : "Optional",
"ForNonTelco": "Optional",
"ForVZ": "Mandatory"
}*/
// struct for classification
type CategoryClassification struct {
FarEdge string
Telco string
NonTelco string
Extended string
}

// TestCaseDescription describes a JUnit test case.
type TestCaseDescription struct {
// Identifier is the unique test identifier.
Expand All @@ -57,14 +42,21 @@ type TestCaseDescription struct {
// Whether or not automated tests exist for the test case. Not to be rendered.
Qe bool `json:"qe" yaml:"qe"`
// classification for each test case
Categoryclassification CategoryClassification `json:"Categoryclassification" yaml:"Categoryclassification"`
CategoryClassification map[string]string `json:"categoryclassification" yaml:"categoryclassification"`
/* an example to how it CategoryClassification would be
{
"ForTelco": "Mandatory",
"FarEdge" : "Optional",
"ForNonTelco": "Optional",
"ForVZ": "Mandatory"
}*/
}

func formTestTags(tags ...string) string {
return strings.Join(tags, ",")
}

func BuildTestCaseDescription(testID, suiteName, description, remediation, testType, exception, reference string, qe bool, categoryclassification CategoryClassification, tags ...string) (TestCaseDescription, Identifier) {
func BuildTestCaseDescription(testID, suiteName, description, remediation, testType, exception, reference string, qe bool, categoryclassification map[string]string, tags ...string) (TestCaseDescription, Identifier) {
aID := Identifier{
Tags: formTestTags(tags...),
Id: suiteName + "-" + testID,
Expand All @@ -79,6 +71,6 @@ func BuildTestCaseDescription(testID, suiteName, description, remediation, testT
aTCDescription.BestPracticeReference = reference
aTCDescription.Tags = strings.Join(tags, ",")
aTCDescription.Qe = qe
aTCDescription.Categoryclassification = categoryclassification
aTCDescription.CategoryClassification = categoryclassification
return aTCDescription, aID
}

0 comments on commit 2dbea12

Please sign in to comment.