-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #176 from AdrianJSClark/174-race-week-parameter-sh…
…ould-be-optional Update Week Number, Club Id, & Division Handling
- Loading branch information
Showing
7 changed files
with
312 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/Aydsko.iRacingData.UnitTests/DictionaryExtensionTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace Aydsko.iRacingData.UnitTests; | ||
|
||
public class DictionaryExtensionTests | ||
{ | ||
[Test, TestCaseSource(nameof(GetTestCases))] | ||
public KeyValuePair<string, string> CheckAddParameterIfNotNull<T>(T value) | ||
{ | ||
var parameters = new Dictionary<string, string>(); | ||
parameters.AddParameterIfNotNull("value", value); | ||
return parameters.ElementAt(0); | ||
} | ||
|
||
public static IEnumerable<TestCaseData> GetTestCases() | ||
{ | ||
yield return new TestCaseData("foo").Returns(new KeyValuePair<string, string>("value", "foo")); | ||
yield return new TestCaseData(new DateTime(2023, 4, 22, 11, 12, 13)).Returns(new KeyValuePair<string, string>("value", "2023-04-22T11:12Z")); | ||
yield return new TestCaseData(new[] { 1, 2, 3 }).Returns(new KeyValuePair<string, string>("value", "1,2,3")); | ||
yield return new TestCaseData(new string[] { "a", "b", "c" }.AsEnumerable()).Returns(new KeyValuePair<string, string>("value", "a,b,c")); | ||
yield return new TestCaseData(true).Returns(new KeyValuePair<string, string>("value", "true")); | ||
yield return new TestCaseData(Common.EventType.Practice).Returns(new KeyValuePair<string, string>("value", "2")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.