INNER CODE UNIT · Go

TestNewClient_CreatesClientWithFieldsProperlySet

samsara/samsara · clients/go/client_test.go:55

func TestNewClient_CreatesClientWithFieldsProperlySet(t *testing.T) {
	config := NewConfig()
	config.Url = "http://test.com"
	config.MaxBufferSize = 555

	client, _ := NewClient(config)

	if !reflect.DeepEqual(config, client.config) {
		t.Errorf("Client's config field. Expected %v, Got %v", config, client.config)
	}
	if client.queue.Size() != 555 {
		t.Errorf("Client's queue should be of size %v, Got %v", 555, client.queue.Size())
	}
}

func TestNewClient_ShouldStartPublishingThreadDependingOnConfiguration(t *testing.T) {
	sets := []struct {
		startPublishing bool

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…