func TestReadRefs(t *testing.T) { client := new(ApiClient) client.Init() project := new(types.Project) project.SetFQName("domain", []string{"default-domain", "p1"}) assert.NoError(t, client.Create(project)) net := new(types.VirtualNetwork) net.SetFQName("project", []string{"default-domain", "p1", "n1"}) assert.NoError(t, client.Create(net)) vmi1 := new(types.VirtualMachineInterface) vmi1.SetFQName("project", []string{"default-domain", "p1", "port1"}) vmi1.AddVirtualNetwork(net) assert.NoError(t, client.Create(vmi1)) refs, err := vmi1.GetVirtualNetworkRefs() assert.NoError(t, err) assert.Len(t, refs, 1) assert.Equal(t, net.GetUuid(), refs[0].Uuid) }