Skip to content
Snippets Groups Projects

Resolve "To improve the device watching mechanism a fetch all after time interval method should be implemented"

1 file
+ 7
1
Compare changes
  • Side-by-side
  • Inline
@@ -124,6 +124,7 @@ func TestNewUpdateEvent(t *testing.T) {
@@ -124,6 +124,7 @@ func TestNewUpdateEvent(t *testing.T) {
func TestNewMneUpdateEvent(t *testing.T) {
func TestNewMneUpdateEvent(t *testing.T) {
type args struct {
type args struct {
entityID uuid.UUID
entityID uuid.UUID
 
paths []string
}
}
tests := []struct {
tests := []struct {
name string
name string
@@ -134,6 +135,7 @@ func TestNewMneUpdateEvent(t *testing.T) {
@@ -134,6 +135,7 @@ func TestNewMneUpdateEvent(t *testing.T) {
name: "should create a new update event",
name: "should create a new update event",
args: args{
args: args{
entityID: getTestEntityUUID(),
entityID: getTestEntityUUID(),
 
paths: []string{"some/random/path"},
},
},
want: Event{
want: Event{
ID: uuid.New(),
ID: uuid.New(),
@@ -145,7 +147,7 @@ func TestNewMneUpdateEvent(t *testing.T) {
@@ -145,7 +147,7 @@ func TestNewMneUpdateEvent(t *testing.T) {
}
}
for _, tt := range tests {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
got := NewMneUpdateEvent(tt.args.entityID, []string{"some/random/path"})
got := NewMneUpdateEvent(tt.args.entityID, tt.args.paths)
if !reflect.DeepEqual(got.EntityID, tt.want.EntityID) {
if !reflect.DeepEqual(got.EntityID, tt.want.EntityID) {
t.Errorf("NewMneUpdateEvent().EntityID = %v, want %v", got, tt.want)
t.Errorf("NewMneUpdateEvent().EntityID = %v, want %v", got, tt.want)
@@ -154,6 +156,10 @@ func TestNewMneUpdateEvent(t *testing.T) {
@@ -154,6 +156,10 @@ func TestNewMneUpdateEvent(t *testing.T) {
if !reflect.DeepEqual(got.Type, tt.want.Type) {
if !reflect.DeepEqual(got.Type, tt.want.Type) {
t.Errorf("NewMneUpdateEvent().Type = %v, want %v", got, tt.want)
t.Errorf("NewMneUpdateEvent().Type = %v, want %v", got, tt.want)
}
}
 
 
if !reflect.DeepEqual(got.Paths, tt.want.Paths) {
 
t.Errorf("NewMneUpdateEvent().Type = %v, want %v", got, tt.want)
 
}
})
})
}
}
}
}
Loading