WIP
parent
b79e096bef
commit
fa132d19a7
|
@ -19,7 +19,9 @@ const (
|
|||
idD = "020f755c3c082003"
|
||||
)
|
||||
|
||||
var faketime = mock.TimeGenerator{FakeValue: time.Date(2006, 5, 4, 1, 2, 3, 0, time.UTC)}
|
||||
var oldFakeDate = time.Date(2002, 8, 5, 2, 2, 3, 0, time.UTC)
|
||||
var fakeDate = time.Date(2006, 5, 4, 1, 2, 3, 0, time.UTC)
|
||||
var fakeGenerator = mock.TimeGenerator{FakeValue: fakeDate}
|
||||
|
||||
var variableCmpOptions = cmp.Options{
|
||||
cmp.Comparer(func(x, y []byte) bool {
|
||||
|
@ -102,7 +104,7 @@ func CreateVariable(init func(VariableFields, *testing.T) (platform.VariableServ
|
|||
return MustIDBase16(idD)
|
||||
},
|
||||
},
|
||||
TimeGenerator: faketime,
|
||||
TimeGenerator: fakeGenerator,
|
||||
Variables: []*platform.Variable{
|
||||
{
|
||||
ID: MustIDBase16(idA),
|
||||
|
@ -138,6 +140,10 @@ func CreateVariable(init func(VariableFields, *testing.T) (platform.VariableServ
|
|||
Type: "constant",
|
||||
Values: platform.VariableConstantValues{"a"},
|
||||
},
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: fakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -150,7 +156,7 @@ func CreateVariable(init func(VariableFields, *testing.T) (platform.VariableServ
|
|||
return MustIDBase16(idA)
|
||||
},
|
||||
},
|
||||
TimeGenerator: faketime,
|
||||
TimeGenerator: fakeGenerator,
|
||||
Variables: []*platform.Variable{
|
||||
{
|
||||
ID: MustIDBase16(idB),
|
||||
|
@ -161,6 +167,10 @@ func CreateVariable(init func(VariableFields, *testing.T) (platform.VariableServ
|
|||
Type: "constant",
|
||||
Values: platform.VariableConstantValues{"b"},
|
||||
},
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: fakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -174,6 +184,10 @@ func CreateVariable(init func(VariableFields, *testing.T) (platform.VariableServ
|
|||
Type: "constant",
|
||||
Values: platform.VariableConstantValues{"a"},
|
||||
},
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: fakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
},
|
||||
wants: wants{
|
||||
|
@ -198,6 +212,10 @@ func CreateVariable(init func(VariableFields, *testing.T) (platform.VariableServ
|
|||
Type: "constant",
|
||||
Values: platform.VariableConstantValues{"a"},
|
||||
},
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: fakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -252,6 +270,10 @@ func FindVariableByID(init func(VariableFields, *testing.T) (platform.VariableSe
|
|||
Type: "constant",
|
||||
Values: platform.VariableConstantValues{},
|
||||
},
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: fakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: MustIDBase16(idB),
|
||||
|
@ -261,6 +283,10 @@ func FindVariableByID(init func(VariableFields, *testing.T) (platform.VariableSe
|
|||
Type: "constant",
|
||||
Values: platform.VariableConstantValues{},
|
||||
},
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: fakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -277,6 +303,10 @@ func FindVariableByID(init func(VariableFields, *testing.T) (platform.VariableSe
|
|||
Type: "constant",
|
||||
Values: platform.VariableConstantValues{},
|
||||
},
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: fakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -354,11 +384,19 @@ func FindVariables(init func(VariableFields, *testing.T) (platform.VariableServi
|
|||
ID: MustIDBase16(idA),
|
||||
OrganizationID: platform.ID(22),
|
||||
Name: "a",
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: fakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: MustIDBase16(idB),
|
||||
OrganizationID: platform.ID(22),
|
||||
Name: "b",
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: fakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -371,11 +409,19 @@ func FindVariables(init func(VariableFields, *testing.T) (platform.VariableServi
|
|||
ID: MustIDBase16(idA),
|
||||
OrganizationID: platform.ID(22),
|
||||
Name: "a",
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: fakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: MustIDBase16(idB),
|
||||
OrganizationID: platform.ID(22),
|
||||
Name: "b",
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: fakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -388,11 +434,19 @@ func FindVariables(init func(VariableFields, *testing.T) (platform.VariableServi
|
|||
ID: MustIDBase16(idA),
|
||||
OrganizationID: platform.ID(22),
|
||||
Name: "a",
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: fakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: MustIDBase16(idB),
|
||||
OrganizationID: platform.ID(22),
|
||||
Name: "b",
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: fakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -412,21 +466,37 @@ func FindVariables(init func(VariableFields, *testing.T) (platform.VariableServi
|
|||
ID: MustIDBase16(idA),
|
||||
OrganizationID: platform.ID(1),
|
||||
Name: "a",
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: fakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: MustIDBase16(idB),
|
||||
OrganizationID: platform.ID(22),
|
||||
Name: "b",
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: fakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: MustIDBase16(idC),
|
||||
OrganizationID: platform.ID(2),
|
||||
Name: "c",
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: fakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: MustIDBase16(idD),
|
||||
OrganizationID: platform.ID(22),
|
||||
Name: "d",
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: fakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -440,11 +510,19 @@ func FindVariables(init func(VariableFields, *testing.T) (platform.VariableServi
|
|||
ID: MustIDBase16(idB),
|
||||
OrganizationID: platform.ID(22),
|
||||
Name: "b",
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: fakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: MustIDBase16(idD),
|
||||
OrganizationID: platform.ID(22),
|
||||
Name: "d",
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: fakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -492,7 +570,7 @@ func UpdateVariable(init func(VariableFields, *testing.T) (platform.VariableServ
|
|||
{
|
||||
name: "updating a variable's name",
|
||||
fields: VariableFields{
|
||||
TimeGenerator: faketime,
|
||||
TimeGenerator: fakeGenerator,
|
||||
Variables: []*platform.Variable{
|
||||
{
|
||||
ID: MustIDBase16(idA),
|
||||
|
@ -502,6 +580,10 @@ func UpdateVariable(init func(VariableFields, *testing.T) (platform.VariableServ
|
|||
Type: "constant",
|
||||
Values: platform.VariableConstantValues{},
|
||||
},
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: oldFakeDate,
|
||||
UpdatedAt: oldFakeDate,
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: MustIDBase16(idB),
|
||||
|
@ -511,6 +593,10 @@ func UpdateVariable(init func(VariableFields, *testing.T) (platform.VariableServ
|
|||
Type: "constant",
|
||||
Values: platform.VariableConstantValues{},
|
||||
},
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: oldFakeDate,
|
||||
UpdatedAt: oldFakeDate,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -531,6 +617,10 @@ func UpdateVariable(init func(VariableFields, *testing.T) (platform.VariableServ
|
|||
Type: "constant",
|
||||
Values: platform.VariableConstantValues{},
|
||||
},
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: oldFakeDate,
|
||||
UpdatedAt: oldFakeDate,
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: MustIDBase16(idB),
|
||||
|
@ -540,6 +630,10 @@ func UpdateVariable(init func(VariableFields, *testing.T) (platform.VariableServ
|
|||
Type: "constant",
|
||||
Values: platform.VariableConstantValues{},
|
||||
},
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: oldFakeDate,
|
||||
UpdatedAt: fakeDate,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -620,6 +714,10 @@ func DeleteVariable(init func(VariableFields, *testing.T) (platform.VariableServ
|
|||
Type: "constant",
|
||||
Values: platform.VariableConstantValues{},
|
||||
},
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: oldFakeDate,
|
||||
UpdatedAt: oldFakeDate,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -643,6 +741,10 @@ func DeleteVariable(init func(VariableFields, *testing.T) (platform.VariableServ
|
|||
Type: "constant",
|
||||
Values: platform.VariableConstantValues{},
|
||||
},
|
||||
CRUDLog: platform.CRUDLog{
|
||||
CreatedAt: oldFakeDate,
|
||||
UpdatedAt: oldFakeDate,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue