fixup multiple client handling
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
		@@ -18,8 +18,8 @@ import (
 | 
				
			|||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestClient(t *testing.T) {
 | 
					func TestClient(t *testing.T) {
 | 
				
			||||||
	c1 := client.NewClient(client.Name("test1"))
 | 
						c1 := client.NewClient(options.Name("test1"))
 | 
				
			||||||
	c2 := client.NewClient(client.Name("test2"))
 | 
						c2 := client.NewClient(options.Name("test2"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	svc := NewService(Client(c1, c2))
 | 
						svc := NewService(Client(c1, c2))
 | 
				
			||||||
	if err := svc.Init(); err != nil {
 | 
						if err := svc.Init(); err != nil {
 | 
				
			||||||
@@ -32,23 +32,6 @@ func TestClient(t *testing.T) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type testItem struct {
 | 
					 | 
				
			||||||
	name string
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func (ti *testItem) Name() string {
 | 
					 | 
				
			||||||
	return ti.name
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func TestGetNameIndex(t *testing.T) {
 | 
					 | 
				
			||||||
	item1 := &testItem{name: "first"}
 | 
					 | 
				
			||||||
	item2 := &testItem{name: "second"}
 | 
					 | 
				
			||||||
	items := []interface{}{item1, item2}
 | 
					 | 
				
			||||||
	if idx := getNameIndex("second", items); idx != 1 {
 | 
					 | 
				
			||||||
		t.Fatalf("getNameIndex func error, item not found")
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func TestRegisterHandler(t *testing.T) {
 | 
					func TestRegisterHandler(t *testing.T) {
 | 
				
			||||||
	type args struct {
 | 
						type args struct {
 | 
				
			||||||
		s    server.Server
 | 
							s    server.Server
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user