update go.mod and imports

This commit is contained in:
2023-03-17 12:54:34 +03:00
parent f3a1a4c83f
commit 437841c8dd
268 changed files with 4019 additions and 2045 deletions

View File

@@ -0,0 +1,75 @@
package locations
import "testing"
var locationItems = ListLocations{
{
GID: 212,
ID: 1,
GUID: 1,
LocationCode: "alfa",
Name: "alfa",
Flag: "",
Meta: []interface{}{
"cloudbroker",
"location",
1,
},
CKey: "",
},
{
GID: 222,
ID: 2,
GUID: 2,
LocationCode: "beta",
Name: "beta",
Flag: "",
Meta: []interface{}{
"cloudbroker",
"location",
1,
},
CKey: "",
},
{
GID: 232,
ID: 3,
GUID: 3,
LocationCode: "gamma",
Name: "gamma",
Flag: "",
Meta: []interface{}{
"cloudbroker",
"location",
1,
},
CKey: "",
},
}
func TestFilterByID(t *testing.T) {
actual := locationItems.FilterByID(1).FindOne()
if actual.ID != 1 {
t.Fatal("expected ID 1, found: ", actual.ID)
}
}
func TestFilterByName(t *testing.T) {
actual := locationItems.FilterByName("gamma").FindOne()
if actual.Name != "gamma" {
t.Fatal("expected Name 'gamma', found: ", actual.Name)
}
}
func TestFilterFunc(t *testing.T) {
actual := locationItems.FilterFunc(func(il ItemLocation) bool {
return il.GID == 212
}).
FindOne()
if actual.GID != 212 {
t.Fatal("expected GID 212, found: ", actual.GID)
}
}

View File

@@ -2,7 +2,7 @@
package locations
import (
"repos.digitalenergy.online/BASIS/decort-golang-sdk/interfaces"
"repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
)
// Structure for creating request to locations

View File

@@ -3,7 +3,7 @@ package locations
import (
"encoding/json"
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/serialization"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/serialization"
)
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.