-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
Add test generator for rna transcription exercise #353
Add test generator for rna transcription exercise #353
Conversation
@@ -8,8 +8,13 @@ public class Complement | |||
{ 'G', 'C' }, { 'C', 'G' }, { 'T', 'A' }, { 'A', 'U' } | |||
}; | |||
|
|||
public static string OfDna(string nucleotide) | |||
public static string ToRna(string nucleotide) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build fails because this (example) class' name has not been renamed to RnaTranscription
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I fixed that and updated the PR.
[Fact(Skip = "Remove to run test")] | ||
public void Correctly_handles_invalid_input_rna_instead_of_dna_() | ||
{ | ||
Assert.Equal(null, RnaTranscription.ToRna("U")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we return null
or throw an exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either way has it's pros and cons, but now that I think about other exercises they're mostly throwing exceptions, so for consistency it probably makes sense to head in that direction.
{ | ||
foreach (var canonicalDataCase in CanonicalData.Cases) | ||
{ | ||
canonicalDataCase.Expected = canonicalDataCase.Expected ?? new UnescapedValue("null"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not ideal and should not be necessary. A null
value should be displayed as null
. I'll try and fix that.
@ErikSchierboom I fixed this generator, could you take a look when you get a chance? |
Thanks! :tada |
And another for #195