Skip to content

Commit 00509c8

Browse files
committed
refactor: SignContractTestData and update global usings
Simplified the SignContractTestData class by changing it from a list of object arrays to inherit from TheoryData. Removed unnecessary implementation of IEnumerator. In the GlobalUsings.cs file, removed an unused global using declaration.
1 parent 3b80388 commit 00509c8

2 files changed

Lines changed: 11 additions & 16 deletions

File tree

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
global using System.Collections;
21
global using FluentAssertions;
3-
global using Xunit;
2+
global using Xunit;
Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
11
namespace EvolutionaryArchitecture.Fitnet.Contracts.Core.UnitTests.SignContract;
22

3-
internal sealed class SignContractTestData : IEnumerable<object[]>
3+
internal sealed class SignContractTestData : TheoryData<DateTimeOffset, DateTimeOffset, DateTimeOffset, DateTimeOffset>
44
{
5-
private readonly List<object[]> _data =
6-
[
7-
[
5+
public SignContractTestData()
6+
{
7+
AddRow(
88
new DateTimeOffset(2021, 1, 1, 1, 1, 1, TimeSpan.Zero),
99
new DateTimeOffset(2021, 1, 1, 1, 1, 1, TimeSpan.Zero),
1010
new DateTimeOffset(2021, 1, 1, 1, 1, 1, TimeSpan.Zero),
1111
new DateTimeOffset(2022, 1, 1, 1, 1, 1, TimeSpan.Zero)
12-
],
13-
[
12+
);
13+
AddRow(
1414
new DateTimeOffset(2022, 6, 1, 12, 0, 0, TimeSpan.Zero),
1515
new DateTimeOffset(2022, 6, 1, 12, 0, 0, TimeSpan.Zero),
1616
new DateTimeOffset(2022, 6, 1, 12, 0, 0, TimeSpan.Zero),
1717
new DateTimeOffset(2023, 6, 1, 12, 0, 0, TimeSpan.Zero)
18-
],
19-
[
18+
);
19+
AddRow(
2020
new DateTimeOffset(2023, 2, 15, 8, 30, 0, TimeSpan.Zero),
2121
new DateTimeOffset(2023, 2, 15, 8, 30, 0, TimeSpan.Zero),
2222
new DateTimeOffset(2023, 2, 15, 8, 30, 0, TimeSpan.Zero),
2323
new DateTimeOffset(2024, 2, 15, 8, 30, 0, TimeSpan.Zero)
24-
]
25-
];
26-
27-
public IEnumerator<object[]> GetEnumerator() => _data.GetEnumerator();
28-
29-
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
24+
);
25+
}
3026
}

0 commit comments

Comments
 (0)