Adding testcases for Configuration. 99/11099/2
authornaman.gupta <naman.gupta@samsung.com>
Mon, 15 May 2023 07:58:17 +0000 (13:28 +0530)
committersubhash kumar singh <subh.singh@samsung.com>
Tue, 16 May 2023 05:35:10 +0000 (05:35 +0000)
Adding testcase for Configuration.

Signed-off-by: naman.gupta <naman.gupta@samsung.com>
Change-Id: I18901dd232f35fdf81441dc415b5b714ced9bc89

config/configuration_test.go [new file with mode: 0644]

diff --git a/config/configuration_test.go b/config/configuration_test.go
new file mode 100644 (file)
index 0000000..3c83597
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+==================================================================================
+  Copyright (c) 2023 Samsung
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+   This source code is part of the near-RT RIC (RAN Intelligent Controller)
+   platform project (RICP).
+==================================================================================
+*/
+package config
+
+import (
+       "testing"
+
+       "github.com/stretchr/testify/assert"
+)
+
+func TestParseConfigurationSuccess(t *testing.T) {
+       config := ParseConfiguration()
+       assert.Equal(t, "debug", config.Logging.LogLevel)
+       assert.Equal(t, "", config.Name)
+       assert.Equal(t, 65536, config.Rmr.MaxMsgSize)
+
+       assert.Equal(t, 0, config.ThreadType)
+       assert.Equal(t, false, config.LowLatency)
+       assert.Equal(t, false, config.FastAck)
+       assert.Equal(t, 1, config.MaxRetryOnFailure)
+       assert.Equal(t, 4561, config.Port)
+}