Vonage / vonage-go-sdk

A lightweight library to help Go users everywhere integrate with the Vonage APIs. Issues and PRs all really welcome!!
https://vonage.github.io/vonage-go-sdk/
Apache License 2.0
51 stars 32 forks source link

Add golang version to user agent header #16

Closed lornajane closed 4 years ago

lornajane commented 5 years ago

Bringing in line with our Repo Standards

lornajane commented 4 years ago

I've had a look at this and found that I had basically recreated TestSetHeader() from the existing sling/sling_test.go. Could you say a bit more about what you're expecting from a test for this please?

judy2k commented 4 years ago

What I was thinking of was a test that calls any client method and checks that the user agent header was provided as expected. Basically a test which will fail if someone changes this line of code in some way.

The problem here is that we don't currently have a test to ensure the user agent is set to the correct value, but it would be great if we did!

See the http-mocked test in https://github.com/nexmo-community/nexmo-go/blob/master/application_test.go for an approach.