corso/src/internal/model/model_test.go
Keepers 6c22d5c0ce
adds store package for wrapping model_store (#346)
* adds store package for wrapping model_store

Introduces the pkg/store package, which contains funcs
for wrapping the model_store with common requests.
This package choice was made for its combination
of being in an accessible place, centralizing functionality
and not introducing circular dependencies.
2022-07-19 11:54:53 -06:00

38 lines
815 B
Go

package model_test
import (
"testing"
"github.com/alcionai/corso/internal/model"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
)
type ModelUnitSuite struct {
suite.Suite
}
func TestModelUnitSuite(t *testing.T) {
suite.Run(t, new(ModelUnitSuite))
}
func (suite *ModelUnitSuite) TestValid() {
table := []struct {
mt model.Schema
expect assert.BoolAssertionFunc
}{
{model.UnknownSchema, assert.False},
{model.BackupOpSchema, assert.True},
{model.RestoreOpSchema, assert.True},
{model.BackupSchema, assert.True},
{model.BackupDetailsSchema, assert.True},
{model.Schema(-1), assert.False},
{model.Schema(100), assert.False},
}
for _, test := range table {
suite.T().Run(test.mt.String(), func(t *testing.T) {
test.expect(t, test.mt.Valid())
})
}
}