Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON document has a string instead of a date #54

Open
Ynhockey opened this issue Jul 29, 2021 · 3 comments
Open

JSON document has a string instead of a date #54

Ynhockey opened this issue Jul 29, 2021 · 3 comments

Comments

@Ynhockey
Copy link

I'm not sure what exactly happens here, but I am comparing two JSON objects with ISO date formats that look like this:

2021-07-20T06:00:00.000Z

The code looks like this:

response.Should().BeEquivalentTo(JObject.Parse(apiResponseContent));

However, while the dates in response are kept, it looks like the dates in apiResponseContent are truncated, and become:

2021-07-20T06:00:00

The test therefore produces an error: JSON document has a string instead of a date at ...

Has anyone encountered this? Is it by design?

@jnyrup
Copy link
Member

jnyrup commented Jul 29, 2021

I'm about to hit the sheets for today, but if you share a complete minimal runnable example I'll try to give it a look tomorrow.

@evilpilaf
Copy link

I just ran into this same issue, when comparing two JObjects, did you ever find a solution @Ynhockey ?

@dennisdoomen
Copy link
Member

@evilpilaf can you provide us with a minimal runnable example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants