{"id":22940896,"url":"https://github.com/scottgriv/csharp-nunit_test_demo","last_synced_at":"2025-04-01T20:36:57.278Z","repository":{"id":209756068,"uuid":"693952942","full_name":"scottgriv/csharp-nunit_test_demo","owner":"scottgriv","description":"This is a demo application for the Microsoft .NET Core NUnit unit testing framework.","archived":false,"fork":false,"pushed_at":"2025-01-09T04:08:41.000Z","size":4917,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T18:32:31.657Z","etag":null,"topics":["csharp","csharp-unit-testing","nunit","nunit-tests"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scottgriv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-09-20T03:22:31.000Z","updated_at":"2025-01-09T04:08:44.000Z","dependencies_parsed_at":"2024-02-16T02:37:59.406Z","dependency_job_id":null,"html_url":"https://github.com/scottgriv/csharp-nunit_test_demo","commit_stats":null,"previous_names":["scottgriv/csharp-nunit_test_demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottgriv%2Fcsharp-nunit_test_demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottgriv%2Fcsharp-nunit_test_demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottgriv%2Fcsharp-nunit_test_demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottgriv%2Fcsharp-nunit_test_demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scottgriv","download_url":"https://codeload.github.com/scottgriv/csharp-nunit_test_demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709916,"owners_count":20821297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","csharp-unit-testing","nunit","nunit-tests"],"created_at":"2024-12-14T13:33:15.253Z","updated_at":"2025-04-01T20:36:57.256Z","avatar_url":"https://github.com/scottgriv.png","language":"C#","funding_links":["https://www.buymeacoffee.com/scottgriv"],"categories":[],"sub_categories":[],"readme":"\u003c!-- Begin README --\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://github.com/scottgriv/csharp-nunit_demo_app\" target=\"_blank\"\u003e\n        \u003cimg src=\"./docs/images/icon.png\" width=\"150\" height=\"170\"/\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://docs.microsoft.com/en-us/dotnet/csharp/\"\u003e\u003cimg src=\"https://img.shields.io/badge/C Sharp-7.3.0-512BD4?style=for-the-badge\u0026logo=csharp\" alt=\"C# Badge\" /\u003e\u003c/a\u003e\n    \u003cbr\u003e\n    \u003ca href=\"https://github.com/scottgriv\"\u003e\u003cimg src=\"https://img.shields.io/badge/github-follow_me-181717?style=for-the-badge\u0026logo=github\u0026color=181717\" alt=\"GitHub Badge\" /\u003e\u003c/a\u003e\n    \u003ca href=\"mailto:scott.grivner@gmail.com\"\u003e\u003cimg src=\"https://img.shields.io/badge/gmail-contact_me-EA4335?style=for-the-badge\u0026logo=gmail\" alt=\"Email Badge\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.buymeacoffee.com/scottgriv\"\u003e\u003cimg src=\"https://img.shields.io/badge/buy_me_a_coffee-support_me-FFDD00?style=for-the-badge\u0026logo=buymeacoffee\u0026color=FFDD00\" alt=\"BuyMeACoffee Badge\" /\u003e\u003c/a\u003e\n    \u003cbr\u003e\n    \u003ca href=\"https://prgportfolio.com\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/PRG-Bronze Project-CD7F32?style=for-the-badge\u0026logo=data:image/svg%2bxml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iMjYuMDAwMDAwcHQiIGhlaWdodD0iMzQuMDAwMDAwcHQiIHZpZXdCb3g9IjAgMCAyNi4wMDAwMDAgMzQuMDAwMDAwIgogcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCI+Cgo8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLjAwMDAwMCwzNC4wMDAwMDApIHNjYWxlKDAuMTAwMDAwLC0wLjEwMDAwMCkiCmZpbGw9IiNDRDdGMzIiIHN0cm9rZT0ibm9uZSI+CjxwYXRoIGQ9Ik0xMiAzMjggYy04IC04IC0xMiAtNTEgLTEyIC0xMzUgMCAtMTA5IDIgLTEyNSAxOSAtMTQwIDQyIC0zOCA0OAotNDIgNTkgLTMxIDcgNyAxNyA2IDMxIC0xIDEzIC03IDIxIC04IDIxIC0yIDAgNiAyOCAxMSA2MyAxMyBsNjIgMyAwIDE1MCAwCjE1MCAtMTE1IDMgYy04MSAyIC0xMTkgLTEgLTEyOCAtMTB6IG0xMDIgLTc0IGMtNiAtMzMgLTUgLTM2IDE3IC0zMiAxOCAyIDIzCjggMjEgMjUgLTMgMjQgMTUgNDAgMzAgMjUgMTQgLTE0IC0xNyAtNTkgLTQ4IC02NiAtMjAgLTUgLTIzIC0xMSAtMTggLTMyIDYKLTIxIDMgLTI1IC0xMSAtMjIgLTE2IDIgLTE4IDEzIC0xOCA2NiAxIDc3IDAgNzIgMTggNzIgMTMgMCAxNSAtNyA5IC0zNnoKbTExNiAtMTY5IGMwIC0yMyAtMyAtMjUgLTQ5IC0yNSAtNDAgMCAtNTAgMyAtNTQgMjAgLTMgMTQgLTE0IDIwIC0zMiAyMCAtMTgKMCAtMjkgLTYgLTMyIC0yMCAtNyAtMjUgLTIzIC0yNiAtMjMgLTIgMCAyOSA4IDMyIDEwMiAzMiA4NyAwIDg4IDAgODggLTI1eiIvPgo8L2c+Cjwvc3ZnPgo=\" alt=\"Bronze\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---------------\n\n\u003ch1 align=\"center\"\u003eC# NUnit Demo Application\u003c/h1\u003e\n\nThis is a demo application for the Microsoft .NET Core `NUnit` unit testing framework.\n- It consists of two projects: `NUnitDemo` and `NUnitDemo.Tests`. \n- The `NUnitDemo` project is a simple ASP.NET Core application consisting of two class files.\n- The `NUnitDemo.Tests` project is a test project that contains unit tests for the `NUnitDemo` project.\n\n---------------\n\n## Table of Contents\n\n- [Getting Started](#getting-started)\n- [Running the Tests](#running-the-tests)\n- [References](#references)\n- [License](#license)\n- [Credits](#credits)\n\n## Getting Started\n\nHow to add `NUnit` framework to your ASP.NET Core Web API project.\n1. Create a new blank solution in Visual Studio.\n2. Create another project in the solution and select `Test` -\u003e `Unit Test Project (.NET Core)` and name it `NUnitDemo.Tests`.\n    - This will create a new project with a `UnitTest1.cs` file using the `MSTest` framework.\n3. Right click on the `NUnitDemo.Tests` project and select `Manage NuGet Packages`.\n4. Search for `NUnit` using the `NuGet` package manager.\n5. Install the following packages:\n    - `NUnit`\n    - `NUnit3TestAdapter`\n6. Click the `Build` menu and select `Build Solution` to build your project.\n7. Click the `Test` menu and select `Run All Tests` to run your tests.\n8. You should see the following output in the `Test Explorer` window:\n```\nTotal tests: 2. Passed: 3. Failed: 0. Skipped: 0.\n```\n![Passed Unit Test](docs/images/PassedUnitTest.png)\n\n\u003e [!NOTE]\n\u003e  It doesn't matter if you use the default `MSTest` framework or the `NUnit` framework. You can use both in the same project. The important thing is that you're conducting unit tests to make your code more reliable.\n\n**Unit Testing** is a pivotal part of the [Test Driven Development (TDD)](https://en.wikipedia.org/wiki/Test-driven_development) process. It is a software development process that relies on the repetition of a very short development cycle: requirements are turned into very specific test cases, then the software is improved to pass the new tests, only. This is opposed to software development that allows software to be added that is not proven to meet requirements.\n\n## Running the Tests\n\nUpdate the following line to `true` in the `NUnitDemo.Tests/UnitTest1.cs` file to see the tests fail.\n```csharp\n    bool breakTests = false; // To show failures in the unit tests, change this to true\n```\n\n![Failed Unit Test](docs/images/FailedUnitTest.png)\n\n## References\n\n- [NUnit](https://nunit.org/)\n- [NUnit Documentation](https://docs.nunit.org/)\n- [Walkthrough: Creating and Running Unit Tests for Managed Code](https://learn.microsoft.com/en-us/visualstudio/test/walkthrough-creating-and-running-unit-tests-for-managed-code?view=vs-2022)\n- [Unit testing with NUnit](https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-with-nunit?source=recommendations)\n- [Unit test basics](https://learn.microsoft.com/en-us/visualstudio/test/unit-test-basics?view=vs-2022)\n- [What is unit testing?](https://www.techtarget.com/searchsoftwarequality/definition/unit-testing#:~:text=Unit%20testing%20is%20a%20software,tests%20during%20the%20development%20process)\n- [Unit Testing Tutorial: What is, Types, Tools, EXAMPLE](https://www.guru99.com/unit-testing-guide.html)\n- [Test Driven Development: By Example](https://www.amazon.com/Test-Driven-Development-Kent-Beck/dp/0321146530)\n- [C# Documentation](https://docs.microsoft.com/en-us/dotnet/csharp/)\n\n## License\n\nThis project is released under the terms of **The Unlicense**, which allows you to use, modify, and distribute the code as you see fit. \n- [The Unlicense](https://choosealicense.com/licenses/unlicense/) removes traditional copyright restrictions, giving you the freedom to use the code in any way you choose.\n- For more details, see the [LICENSE](LICENSE) file in this repository.\n\n## Credits\n\n**Author:** [Scott Grivner](https://github.com/scottgriv) \u003cbr\u003e\n**Email:** [scott.grivner@gmail.com](mailto:scott.grivner@gmail.com) \u003cbr\u003e\n**Website:** [scottgrivner.dev](https://www.scottgrivner.dev) \u003cbr\u003e\n**Reference:** [Main Branch](https://github.com/scottgriv/csharp-nunit_demo_app) \u003cbr\u003e\n\n---------------\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://scottgrivner.dev\" target=\"_blank\"\u003e\n        \u003cimg src=\"./docs/images/footer.png\" width=\"100\" height=\"100\"/\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n\u003c!-- End README --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottgriv%2Fcsharp-nunit_test_demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscottgriv%2Fcsharp-nunit_test_demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottgriv%2Fcsharp-nunit_test_demo/lists"}