github.com/msales/pkg/v3@v3.24.0/grpcx/options_test.go (about)

     1  package grpcx_test
     2  
     3  import (
     4  	"context"
     5  	"testing"
     6  	"time"
     7  
     8  	"github.com/msales/pkg/v3/grpcx"
     9  	"github.com/stretchr/testify/assert"
    10  )
    11  
    12  func TestUnaryServerCommonOpts(t *testing.T) {
    13  	opts := grpcx.UnaryServerCommonOpts(context.Background())
    14  
    15  	assert.Len(t, opts, 2)
    16  }
    17  
    18  func TestStreamServerCommonOpts(t *testing.T) {
    19  	opts := grpcx.StreamServerCommonOpts(context.Background())
    20  
    21  	assert.Len(t, opts, 2)
    22  }
    23  
    24  func TestUnaryClientCommonOpts(t *testing.T) {
    25  	opts := grpcx.UnaryClientCommonOpts(context.Background(), 1*time.Second)
    26  
    27  	assert.Len(t, opts, 3)
    28  }