mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Add unit tests on ees
This commit is contained in:
committed by
Dan Christian Bogos
parent
3863a37ecb
commit
09e9939482
@@ -50,3 +50,32 @@ func TestVirtualEeExportEvent(t *testing.T) {
|
||||
}
|
||||
vEe.Close()
|
||||
}
|
||||
|
||||
func TestVirtualEeConnect(t *testing.T) {
|
||||
vEe := &VirtualEE{}
|
||||
err := vEe.Connect()
|
||||
if err != nil {
|
||||
t.Errorf("Connect() returned an error: %v, expected nil", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVirtualEE_PrepareMap(t *testing.T) {
|
||||
vEe := &VirtualEE{}
|
||||
event := "test event"
|
||||
cgrEv := &utils.CGREvent{
|
||||
Tenant: "event",
|
||||
}
|
||||
|
||||
// Test case when PrepareMap is called
|
||||
result, err := vEe.PrepareMap(cgrEv)
|
||||
|
||||
// Check that the returned error is nil
|
||||
if err != nil {
|
||||
t.Errorf("PrepareMap() returned an error: %v, expected nil", err)
|
||||
}
|
||||
|
||||
// Check that the returned result is the expected event
|
||||
if result != event {
|
||||
t.Errorf("PrepareMap() returned %v, expected %v", result, event)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user