Skip to content

RNA-Transcription: Add invalid input #305

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion exercises/rna-transcription/uTestRnaTranscription.pas
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ RnaTranscriptionTest = class(TObject)
[Test]
[Ignore]
procedure Rna_complement;
[Test]
[Ignore]
procedure Rna_complement_with_invalid_input;
end;

implementation
uses uRnaTranscription;
uses uRnaTranscription, SysUtils;

procedure RnaTranscriptionTest.Rna_complement_of_cytosine_is_guanine;
begin
Expand Down Expand Up @@ -69,6 +72,16 @@ procedure RnaTranscriptionTest.Rna_complement;
Assert.AreEqual('UGCACCAGAAUU', complement.OfDna('ACGTGGTCTTAA'));
end;

procedure RnaTranscriptionTest.Rna_complement_with_invalid_input;
var MyProc: TTestLocalMethod;
begin
MyProc := procedure
begin
complement.OfDna('ACGTXXXCTTAA');
end;
Assert.WillRaiseWithMessage(MyProc, Exception, 'Invalid DNA character');
end;

initialization
TDUnitX.RegisterTestFixture(RnaTranscriptionTest);
end.