github.com/altipla-consulting/ravendb-go-client@v0.1.3/document_conventions_test.go (about)

     1  package ravendb
     2  
     3  import (
     4  	"reflect"
     5  	"testing"
     6  
     7  	"github.com/stretchr/testify/assert"
     8  )
     9  
    10  type User struct {
    11  	ID   string
    12  	Name string
    13  }
    14  
    15  func TestDefaultGetCollectionName(t *testing.T) {
    16  	name := getCollectionNameForTypeOrEntity(&User{})
    17  	assert.Equal(t, "Users", name)
    18  	name = getCollectionNameForTypeOrEntity(reflect.TypeOf(&User{}))
    19  	assert.Equal(t, "Users", name)
    20  }