MethodsAndPractices / vsteam

PowerShell module for accessing Azure DevOps Services and Azure DevOps Server (formerly VSTS or TFS)
https://methodsandpractices.github.io/vsteam-docs/
MIT License
447 stars 155 forks source link

fix tests that involve dates fail when OS culture has 24 hours format #506

Closed mnieto closed 1 year ago

mnieto commented 1 year ago

PR Summary

Inside the vsteam-lib.Test project, tests that have Asserts based on date format (i.e. actual.CreatedOn.ToString("M/d/yyyy h:mm:ss tt").) fails when ran in a Windows machine configured with 24h format, for example Spanish. See: https://stackoverflow.com/q/38976486/777551

Example of error: image

The solution is to use an invariant culture so tests will be independent of the local configuration

PR Checklist

mnieto commented 1 year ago

@SebastianSchuetze, can you please review last changes and merge?