X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=common%2Futils_test.go;h=f9d71ccabf84c5b6bb2b9485cbf3e7563640645f;hb=b7853804b4f2b3d74ebe2458609ffad0a1751de4;hp=640362c23c892468516e5e481e1f63b06e254cac;hpb=286ce41c7d5049e688a40f68e4c6681a645add3d;p=ric-plt%2Fnodeb-rnib.git diff --git a/common/utils_test.go b/common/utils_test.go index 640362c..f9d71cc 100644 --- a/common/utils_test.go +++ b/common/utils_test.go @@ -124,4 +124,25 @@ func TestValidateAndBuildCellNamePciKeySuccess(t *testing.T){ assert.Contains(t, key, delimiter) assert.Contains(t, key, prefix) assert.Contains(t, key, "270f") +} + + +func TestValidateAndBuildRanLoadInformationKeySuccess(t *testing.T) { + name := "name" + prefix := "LOAD" + delimiter := ":" + key, err := ValidateAndBuildRanLoadInformationKey(name) + if err != nil{ + t.Errorf("#utils_test.TestValidateAndBuildRanLoadInformationKeySuccess - failed to validate key parameter") + } + assert.Contains(t, key, name) + assert.Contains(t, key, delimiter) + assert.Contains(t, key, prefix) +} + +func TestValidateAndBuildRanLoadInformationKeyFailure(t *testing.T) { + name := "" + _, err := ValidateAndBuildRanLoadInformationKey(name) + assert.NotNil(t, err) + assert.Equal(t, VALIDATION_ERROR, err.GetCode()) } \ No newline at end of file