Closed AbraaoAlves closed 12 years ago
Hi Abraão, thank you for your pull request.
Do you mind doing us two things before we can merge your changes?
First, I understand it would be better to make it CultureInvariant instead of hard-coding en-US as the Culture, what do you think?
Also, can you please add a test to the AcceptHeaderToMediaTypeTests TestFixture that reproduces the issue that you are fixing?
Again, thanks for your help.
Quando eu fiz o download do codigo fonte esses testes estavam quebrando:
ShouldReturnMostQualifiedMediaTypeWhenDefaultHasQualifier ShouldReturnMostQualifiedMediaTypeWhenQualifierIsNotPresent in Restfulie.Server.Tests.Negotiation.AcceptHeaderToMediaTypeTests.
Para ver isso é só setar a cultura na sua maquina ou no web.config para "pt-Br", onde a instrução Convert.ToDouble("0.8") retorna 8.0 (double) e Convert.ToDouble("0,8") retorna 0.8(double). Isso faz total diferença para o metodo private MostQualifiedMediaType.
Eu acho melhor setar a cultura no código mesmo porque o formato da string nunca muda e isso trás menos dor de cabeça para quem for utilizar-lo.
Hi Abraao,
Can you just write a test that shows that your implementation works regardless the culture of the server?
...uldReturnMostQualifiedMediaTypeWhenQualifierIsNotPresent] when culture is no en-US.
Example: when this project is used in a project with culture pt-Br, qualifier 0.9 is converted to 9.0