22 lines
549 B
Go
22 lines
549 B
Go
package scenes
|
|
|
|
import (
|
|
"encoding/json"
|
|
"testing"
|
|
)
|
|
|
|
func TestResponseStructAcceptsIntegerBoundaries(t *testing.T) {
|
|
raw := []byte(`{"scenes":[{"start_unit_id":1,"end_unit_id":3}]}`)
|
|
|
|
var response chunkResponse
|
|
if err := json.Unmarshal(raw, &response); err != nil {
|
|
t.Fatalf("Unmarshal() error = %v, want nil", err)
|
|
}
|
|
if got := response.Scenes[0].StartUnitID.String(); got != "1" {
|
|
t.Fatalf("StartUnitID = %q, want 1", got)
|
|
}
|
|
if got := response.Scenes[0].EndUnitID.String(); got != "3" {
|
|
t.Fatalf("EndUnitID = %q, want 3", got)
|
|
}
|
|
}
|