-
-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
all-your-base: add generator (#2359)
[no important files changed]
- Loading branch information
1 parent
2783eaf
commit 8f999a6
Showing
3 changed files
with
76 additions
and
98 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using Xunit; | ||
|
||
public class AllYourBaseTests | ||
{ | ||
{{for testCase in testCases}} | ||
[Fact{{if !for.first}}(Skip = "Remove this Skip property to run this test"){{end}}] | ||
public void {{testCase.testMethodName}}() | ||
{ | ||
{{if testCase.expected.error}} | ||
int[] digits = {{testCase.input.digits}}; | ||
Assert.Throws<ArgumentException>(() => AllYourBase.Rebase({{testCase.input.inputBase}}, digits, {{testCase.input.outputBase}})); | ||
{{else}} | ||
int[] digits = {{testCase.input.digits}}; | ||
int[] expected = {{testCase.expected}}; | ||
Assert.Equal(expected, AllYourBase.Rebase({{testCase.input.inputBase}}, digits, {{testCase.input.outputBase}})); | ||
{{end}} | ||
} | ||
{{end}} | ||
} |
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
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