mardi 26 juillet 2016

TFS reads a C# string incorrect

So, this is an odd one:

I have a TFS 2015 (Update 3) running my tests from a smaller program. I do unit tests on my code, and recently set TFS up to do them as well. Then suddenly a wild error appears in a simple math function - on the TFS, but not on my own machine.

Starting with the test output from TFS, where I cropped for relevant data: enter image description here

And here for my local host's test: enter image description here

The difference can be found in Raw Input: 561077866 (for TFS) and Raw Input: 5610.77866 (for local host).

TFS forgets about the dot!

So - where does it go wrong?

The test being run:

enter image description here

Predefined data - this will not change. Then I call a class object which stores the data in a string in the object - this is where it goes wrong:

enter image description here

Then I call the getter-property Latitude to perform some simple math:

enter image description here


EDIT:

So it turns out, that TFS reads Danish, while local host reads English. The Danish language uses , to separate decimal and integers, while the English language uses ..

Aucun commentaire:

Enregistrer un commentaire