-
Notifications
You must be signed in to change notification settings - Fork 0
Example renaming of some tests to the Given When Then style #1
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
base: master
Are you sure you want to change the base?
Changes from all commits
15bb2fd
0106d9e
710a922
64c8966
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,7 +95,7 @@ void beforeEach() { | |
| } | ||
|
|
||
| @Test | ||
| void updateTranscriptionApprovedWithoutComment() throws Exception { | ||
| void givenAwaitingAuthorisationTranscription_whenApproveWithoutCommentIsRequested_thenNewStatusIsApprovedAndHasNoComment() throws Exception { | ||
|
|
||
| TranscriptionEntity existingTranscription = dartsDatabase.getTranscriptionRepository().findById( | ||
| transcriptionId).orElseThrow(); | ||
|
|
@@ -145,7 +145,7 @@ void updateTranscriptionApprovedWithoutComment() throws Exception { | |
| } | ||
|
|
||
| @Test | ||
| void updateTranscriptionApprovedWithComment() throws Exception { | ||
| void givenAwaitingAuthorisationTranscription_whenApproveWithCommentIsRequested_thenNewStatusIsApprovedAndHasComment() throws Exception { | ||
|
|
||
| UpdateTranscription updateTranscription = new UpdateTranscription(); | ||
| updateTranscription.setTranscriptionStatusId(APPROVED.getId()); | ||
|
|
@@ -190,7 +190,7 @@ void updateTranscriptionApprovedWithComment() throws Exception { | |
| } | ||
|
|
||
| @Test | ||
| void updateTranscriptionShouldReturnTranscriptionNotFoundError() throws Exception { | ||
| void whenUpdateTranscriptionForNonExistingTranscriptionIsRequested_thenErrorIsReturned() throws Exception { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't you need a given statement on here?
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jackmaloney I initially had the test name as: but the But if you prefer always having a |
||
| UpdateTranscription updateTranscription = new UpdateTranscription(); | ||
| updateTranscription.setTranscriptionStatusId(APPROVED.getId()); | ||
| updateTranscription.setWorkflowComment("APPROVED"); | ||
|
|
@@ -216,7 +216,7 @@ void updateTranscriptionShouldReturnTranscriptionNotFoundError() throws Exceptio | |
| } | ||
|
|
||
| @Test | ||
| void updateTranscriptionShouldReturnTranscriptionWorkflowActionInvalidError() throws Exception { | ||
| void givenExistingTranscription_whenUpdateToInvalidStatusIsRequested_thenErrorIsReturned() throws Exception { | ||
| UpdateTranscription updateTranscription = new UpdateTranscription(); | ||
| updateTranscription.setTranscriptionStatusId(WITH_TRANSCRIBER.getId()); | ||
| updateTranscription.setWorkflowComment("APPROVED"); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ void setUp() { | |
| } | ||
|
|
||
| @Test | ||
| void testMapToMedia() { | ||
| void givenCourtroomExistsOrCreated_whenMapCourtroomAudioMetadataToMediaIsRequested_thenMetadataIsSuccessfullyMapped() { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could get tedious when writing lots of unit tests. I tend to think of these as
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hey @davet1985, it's true, for some test types it takes a bit of diligence and effort to come up with a good given/when/then name |
||
| CourthouseEntity courthouse = new CourthouseEntity(); | ||
| courthouse.setCourthouseName("SWANSEA"); | ||
|
|
||
|
|
||
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 this be givenANonExistingTranscription_whenGetTranscriptionDetailsIsRequested_thenAnErrorisReturned()
Uh oh!
There was an error while loading. Please reload this page.
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.
hi @mestebanez, you raised a good point. @jackmaloney raised a similar one here.
Please let me know your preference