Skip to content

Hardcoded date time values in unit tests fail outside of EST #2

@JFisk42

Description

@JFisk42

Describe the Issue
Hardcoded date times in the unit tests cause failures when run in a system that is not in the eastern timezone. I live 3 hours behind EST so the unit tests below all had the hours shifted by three.

To Reproduce
Steps to reproduce the behavior:

  1. Have your system set to a timezone outside of EST
  2. Run the unit tests dotnet test
  3. The 4 ScoreAudit unit tests should now fail.

Expected behavior
Unit tests should pass in every timezone :)

Screenshots

❌ FAILED: ScoreAuditMessage1_ReturnsExpectedResponse(endpoint: "/PIQI/ScoreAuditMessage") (1611ms)
   Assert.Equal() Failure: Strings differ
    Expected: ···"e":{"data":"1/2/202612:00:00AM","attribut"···
    Actual:   ···"e":{"data":"1/2/20263:00:00AM","attribute"···

❌ FAILED: ScoreAuditMessage2_ReturnsExpectedResponse(endpoint: "/PIQI/ScoreAuditMessage") (1295ms)
   Assert.Equal() Failure: Strings differ
    Expected: ···"":{"data":"8/12/20261:00:00AM","attribute"···
    Actual:   ···"":{"data":"8/12/20264:00:00AM","attribute"···

❌ FAILED: ScoreAuditMessage4_ReturnsExpectedResponse(endpoint: "/PIQI/ScoreAuditMessage") (1513ms)
   Assert.Equal() Failure: Strings differ
    Expected: ···"":{"data":"6/21/20261:00:00AM","attribute"···
    Actual:   ···"":{"data":"6/21/20264:00:00AM","attribute"···

❌ FAILED: ScoreAuditMessage3_ReturnsExpectedResponse(endpoint: "/PIQI/ScoreAuditMessage") (2008ms)
   Assert.Equal() Failure: Strings differ
    Expected: ···"":{"data":"6/21/20261:00:00AM","attribute"···
    Actual:   ···"":{"data":"6/21/20264:00:00AM","attribute"···

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions