Skip to content

Instantly share code, notes, and snippets.

@LeilaniL
Last active May 18, 2021 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeilaniL/124654f6edd11b71ee77c9d8de187e52 to your computer and use it in GitHub Desktop.
Save LeilaniL/124654f6edd11b71ee77c9d8de187e52 to your computer and use it in GitHub Desktop.
{
"one expect statement per test": {
"prefix": "expect",
"body": "Be careful how many `expect` or `Assert` statements are checked per test. You want unit tests to only check one thing at a time, so if one fails, it's easy to spot what part of your code isn't working.",
"description": "one expect per test"
},
"name tests descriptively": {
"prefix": "name tests",
"body": "Remember to name your tests descriptively, including the expected behavior. For example, in C# the format is `public void NameOfMethodWeAreTesting_DescriptionOfBehavior_ExpectedReturnValue()` e.g. `IsLeapYear_NumberDivisibleByFour_True`.",
"description": "format of C# test names"
},
"better setup instructions": {
"prefix": "more detailed setup instructions",
"body": "Have more detailed setup instructions, so someone who's never used .NET can easily run your project/tests. Here's an article with good README examples: [Medium: Guide to Writing a Kickass ReadMe](https://medium.com/@meakaakka/a-beginners-guide-to-writing-a-kickass-readme-7ac01da88ab3)",
"description": "more detailed setup instructions"
},
"Add info about tests": {
"prefix": "add info on how to run tests",
"body": "Add info to README on how to run tests: `dotnet test` `npm run test`",
"description": "add info on how to run tests"
},
"Make use of object properties": {
"prefix": "Make use of object properties",
"body": "Make use of your object properties, the info already stored, rather than passing in the same info as an argument or returning something new",
"description": "Make use of object properties rather than passing in"
},
"unused using statements": {
"prefix": "Some unnecessary `using` directives (see Home controller)",
"body": "Some unnecessary `using` directives (see Home controller)",
"description": "Some unnecessary `using` directives (see Home controller)"
},
"properties should be Pascal case": {
"prefix": "properties should be upper or pascal case",
"body": "Property names like `totalBreadRequested` should be PascalCase instead of camelCase",
"description": "Property names like `totalBreadRequested` should be PascalCase instead of camelCase"
},
"separate file per class": {
"prefix": "Separate classes into their own files: Bread.cs, Pastry.cs etc.",
"body": "Separate classes into their own files: Bread.cs, Pastry.cs etc.",
"description": "Separate classes into their own files: Bread.cs, Pastry.cs etc."
},
"prevent empty form submission": {
"prefix": "Can submit empty",
"body": " * Users can submit empty forms and create blank vendors or orders",
"description": "Users can submit empty forms and create blank vendors or orders"
}
}
@LeilaniL
Copy link
Author

See https://github.com/epicodus-classroom/code-review-snippets for info on VS Code snippets and how to set them up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment