adamyeager / PushbulletSharp

This is a simple pushbullet wrapper written in C#.
MIT License
52 stars 61 forks source link

Use InvariantCulture to convert double representation of ModifiedDate to string #14

Closed DriesPeeters closed 8 years ago

DriesPeeters commented 8 years ago

Hi,

I live in Belgium and I had a bug when I use the getPushes method. I always got the following error: {"Assert.Fail failed. 400 Bad Request - Usually this results from missing a required parameter."}

After some debugging I found that the Pushbullet API does not work with comma characters in the modified_after field. Since this field can be a double value, and in Belgium the default conversion of a double to a string contains a comma, I changed the double to string conversion code in the getPushes method.

Reproduction of the error:

  1. Change your laptop's region setting to 'Dutch (Belgium)'
  2. Use a non integer DateTime value (as I added in the unit test)
  3. Execute the GetPushesAllSince unit test
  4. You will get the error above

Done to fix the issue: Changed the Culture of the conversion to InvariantCulture.

Kind regards, Dries