{"id":19649045,"url":"https://github.com/alexashley/csharp-tdd","last_synced_at":"2026-05-26T16:37:06.482Z","repository":{"id":96721462,"uuid":"81902359","full_name":"alexashley/csharp-tdd","owner":"alexashley","description":"TDD w/ C#","archived":false,"fork":false,"pushed_at":"2017-03-14T21:06:23.000Z","size":12,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-27T00:49:38.454Z","etag":null,"topics":["csharp","tdd"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexashley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-14T03:49:59.000Z","updated_at":"2018-09-06T13:52:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"4c67572e-02a7-4db3-b7a7-02623eea8af0","html_url":"https://github.com/alexashley/csharp-tdd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alexashley/csharp-tdd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexashley%2Fcsharp-tdd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexashley%2Fcsharp-tdd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexashley%2Fcsharp-tdd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexashley%2Fcsharp-tdd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexashley","download_url":"https://codeload.github.com/alexashley/csharp-tdd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexashley%2Fcsharp-tdd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33530292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"ssl_error","status_checked_at":"2026-05-26T15:22:15.568Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","tdd"],"created_at":"2024-11-11T14:51:22.984Z","updated_at":"2026-05-26T16:37:06.476Z","avatar_url":"https://github.com/alexashley.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Test-Driven Development with C\u0026#35;\n\n\n### Getting Started\n- Install [Resharper](https://www.jetbrains.com/resharper/download/)\n  * optional, but highly recommended\n- Find a buddy!\n\n### How\n- Pair-programming\n  - Frequently switch the driver/navigator roles with ping-ponging: one person writes a test, the other passes it and writes the next test\n  - [Benefits of pair-programming](https://pdfs.semanticscholar.org/1d4c/7da6969ad0df86aa1d81274305fddc1e20e0.pdf)\n- Structure a unit test\n   * Arrange / Given\n   * Act / When\n   * Assert / Then\n- [Inversion of control](https://martinfowler.com/articles/injection.html)\n   * Use constructor-based dependency injection with your IoC framework of choice\n     - Naturally limits the number of hard dependencies as you see the number of constructor arguments grow\n     - Ensures that the class is fully initialized before it's used (unlike setter-based injection)\n- Write easily testable code\n   * Clean code and testable code go hand in hand\n   * [What does untestable code look like?](https://testing.googleblog.com/2008/07/how-to-write-3v1l-untestable-code.html)\n   * [Guide to writing testable code](http://misko.hevery.com/attachments/Guide-Writing%20Testable%20Code.pdf) (Java)\n   \n### Tools\n\n#### Inversion of Control Frameworks\n\n- Autofac\n- Unity\n- Spring.NET\n- Lots more: http://stackoverflow.com/a/227012\n\n#### Test Frameworks\n - `NUnit`\n - `MSTest`\n \n#### Stubbing \u0026 Mocking\n- Use [`Moq`](https://github.com/moq/moq4) for interfaces and abstract classes\n    * [Moq vs other C# mocking frameworks](http://blogs.clariusconsulting.net/kzu/why-do-we-need-yet-another-net-mocking-framework/)\n\n- Use [Microsoft Fakes](https://msdn.microsoft.com/en-us/library/hh549175.aspx) for anything else\n    * It generates a fake assembly that the system under test will use instead of the real binary\n    * Note that shims are very slow and tedious to setup, so you may want to wrap the dependency if you'll using it frequently\n \n#### Coverage\n - Visual Studio: `Tests \u003e Analyze Code Coverage \u003e All Tests`\n - [`OpenCoverage`](https://github.com/OpenCover/opencover)\n  * generated HTML reports with [ReportGenerator](https://github.com/danielpalme/ReportGenerator)\n \n#### Fake Test Data\n \n - [`Bogus`](https://github.com/bchavez/Bogus) is a port of `faker.js` and has powerful syntax for filling properties with test data\n \n#### Code Analysis \u0026 Linting\n - Automatic formatting w/ Resharper (ctrl + alt + l)\n - SonarLint\n - StyleCop\n - [`Gendarme`](http://www.mono-project.com/docs/tools+libraries/tools/gendarme/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexashley%2Fcsharp-tdd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexashley%2Fcsharp-tdd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexashley%2Fcsharp-tdd/lists"}