func TestDocumentGetNumberReturnsAnEmptyNumberWhenTheKeyIsNotPresent(t *testing.T) { doc := dynago.Document{} assert.Equal(t, dynago.Number(""), doc.GetNumber("id")) }
func TestDocumentGetNumberPanicsIfTheUnderlyingTypeIsNotANumber(t *testing.T) { doc := dynago.Document{"id": "not-a-dynago-number"} assert.Panics(t, func() { doc.GetNumber("id") }) }
func TestDocumentGetNumberReturnsTheDynagoNumberWrappingTheValue(t *testing.T) { doc := dynago.Document{"id": dynago.Number("12")} assert.Equal(t, dynago.Number("12"), doc.GetNumber("id")) }