add attribute default culture test/fixture
Description
Fixes # (issue)
Checklist
- Is this feature complete?
- [x] Yes. Ready to ship.
- [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if relevant?
- [ ] Yes
- [x] No
- Did you add public API?
- [ ] Yes
- If yes, did you have an API Review for it?
- [ ] Yes
- [ ] No
- Did you add
<remarks />and<code />elements on your triple slash comments?- [ ] Yes
- [ ] No
- If yes, did you have an API Review for it?
- [x] No
- [ ] Yes
- Does the change make any security assumptions or guarantees?
- [ ] Yes
- If yes, have you done a threat model and had a security review?
- [ ] Yes
- [ ] No
- If yes, have you done a threat model and had a security review?
- [x] No
- [ ] Yes
- Does the change require an update in our Aspire docs?
- [ ] Yes
- Link to aspire-docs issue (consider using one of the following templates):
- [x] No
- [ ] Yes
there is a sample for this actually https://github.com/xunit/samples.xunit/blob/main/v3/UseCultureExample/UseCultureAttribute.cs
what do you think of copying that instead @RussKie .. it allows you to pick a culture.
edit -- disregard -- brainstorm -- didn't read the whole PR haha.
Oh nice, v3 now has the attribute!
Test failure:
failed Aspire.Hosting.Tests.ReferenceExpressionTests.ReferenceExpressionHandlesValueWithFormattingInParameterBrackets(input: "{0:D}", parameterValue: 2024-05-22T00:00:00.0000000, expected: "05/22/2024 00:00:00") (1ms)
Assert.Equal() Failure: Strings differ
↓ (pos 0)
Expected: "05/22/2024 00:00:00"
Actual: "5/22/2024 12:00:00 AM"
↑ (pos 0)
Oh nice, v3 now has the attribute!
Unfortunately. It is only on the level of the example and it is not in the assembly.
Test failure:
failed Aspire.Hosting.Tests.ReferenceExpressionTests.ReferenceExpressionHandlesValueWithFormattingInParameterBrackets(input: "{0:D}", parameterValue: 2024-05-22T00:00:00.0000000, expected: "05/22/2024 00:00:00") (1ms) Assert.Equal() Failure: Strings differ ↓ (pos 0) Expected: "05/22/2024 00:00:00" Actual: "5/22/2024 12:00:00 AM" ↑ (pos 0)
I had to transfer expected in to method. Since the resource was static and used culture before the attribute of modify culture was triggered. Yes, there is another option at a higher level to do this for example through itestpipelinestartup. But I don't think this is a good idea.