-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add small documentation skeleton
- Loading branch information
1 parent
c4cb00b
commit 28ce76c
Showing
4 changed files
with
109 additions
and
59 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
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,9 @@ | ||
# Documentation | ||
|
||
This directory contains the documentation for the project. | ||
|
||
## Rules | ||
|
||
This directory contains the documentation for the rules. | ||
- [Present Tense](rules/present-tense.md) | ||
- [Camel Case](rules/camel-case.md) |
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,42 @@ | ||
# Camel Case | ||
|
||
Each test name has to be written by using [camel case](https://en.wikipedia.org/wiki/Camel_case). | ||
|
||
Correct examples: | ||
```java | ||
public class UserTest { | ||
@Test | ||
public void createsUser() { | ||
// correct | ||
} | ||
|
||
@Test | ||
public void createsUserWithoutName() { | ||
// correct | ||
} | ||
|
||
@Test | ||
public void removesUser() { | ||
// correct | ||
} | ||
} | ||
``` | ||
Incorrect examples: | ||
```java | ||
public class UserTest { | ||
@Test | ||
public void create_user() { | ||
// invalid! | ||
} | ||
|
||
@Test | ||
public void user_is_created() { | ||
// invalid! | ||
} | ||
|
||
@Test | ||
public void user$is$removed() { | ||
// invalid! | ||
} | ||
} | ||
``` |
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,46 @@ | ||
# Present tense | ||
|
||
The test method name should be a sentence that describes the test case using | ||
present tense without subject. For example, if you have a test that tests | ||
a `User` class, then the test method name should start from the verb followed by | ||
any testing conditions. For example: | ||
|
||
```java | ||
public class UserTest { | ||
@Test | ||
public void createsUser() { | ||
// correct | ||
} | ||
|
||
@Test | ||
public void createsUserWithoutName() { | ||
// correct | ||
} | ||
|
||
@Test | ||
public void removesUser() { | ||
// correct | ||
} | ||
} | ||
``` | ||
|
||
The next cases will be considered as invalid: | ||
|
||
```java | ||
public class UserTest { | ||
@Test | ||
public void createUser() { | ||
// invalid! | ||
} | ||
|
||
@Test | ||
public void userIsCreated() { | ||
// invalid! | ||
} | ||
|
||
@Test | ||
public void userIsRemoved() { | ||
// invalid! | ||
} | ||
} | ||
``` |