Skip to content
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

Merged
merged 3 commits into from
Aug 19, 2017

Conversation

robkeim
Copy link
Contributor

@robkeim robkeim commented Aug 18, 2017

And another for #195

@@ -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)
Copy link
Member

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.

Copy link
Contributor Author

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"));
Copy link
Member

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?

Copy link
Contributor Author

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");
Copy link
Member

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.

@robkeim
Copy link
Contributor Author

robkeim commented Aug 19, 2017

@ErikSchierboom I fixed this generator, could you take a look when you get a chance?

@ErikSchierboom ErikSchierboom merged commit 54d2c17 into exercism:master Aug 19, 2017
@ErikSchierboom
Copy link
Member

Thanks! :tada

@robkeim robkeim deleted the generator-rna-transcription branch August 19, 2017 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants