{"id":18624398,"url":"https://github.com/yogyogi/asp.net-core-unit-testing-with-xunit","last_synced_at":"2026-04-01T17:17:53.100Z","repository":{"id":40458211,"uuid":"378380825","full_name":"yogyogi/ASP.NET-Core-Unit-Testing-with-xUnit","owner":"yogyogi","description":"How to perform Unit Testing with xUnit in ASP.NET Core","archived":false,"fork":false,"pushed_at":"2024-02-14T12:53:32.000Z","size":38419,"stargazers_count":21,"open_issues_count":0,"forks_count":16,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-28T01:30:29.252Z","etag":null,"topics":["aspnetcore","integration-testing","moq","selenium","selenium-csharp","selenium-tests","selenium-webdriver","testing","ui-testing","unit-test","unit-testing","xunit"],"latest_commit_sha":null,"homepage":"https://www.hosting.work/aspnet-core-xunit-unit-testing/","language":"C#","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/yogyogi.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":"2021-06-19T10:06:55.000Z","updated_at":"2025-10-18T14:59:08.000Z","dependencies_parsed_at":"2024-02-14T13:57:05.272Z","dependency_job_id":null,"html_url":"https://github.com/yogyogi/ASP.NET-Core-Unit-Testing-with-xUnit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yogyogi/ASP.NET-Core-Unit-Testing-with-xUnit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yogyogi%2FASP.NET-Core-Unit-Testing-with-xUnit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yogyogi%2FASP.NET-Core-Unit-Testing-with-xUnit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yogyogi%2FASP.NET-Core-Unit-Testing-with-xUnit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yogyogi%2FASP.NET-Core-Unit-Testing-with-xUnit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yogyogi","download_url":"https://codeload.github.com/yogyogi/ASP.NET-Core-Unit-Testing-with-xUnit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yogyogi%2FASP.NET-Core-Unit-Testing-with-xUnit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: 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":["aspnetcore","integration-testing","moq","selenium","selenium-csharp","selenium-tests","selenium-webdriver","testing","ui-testing","unit-test","unit-testing","xunit"],"created_at":"2024-11-07T04:28:54.743Z","updated_at":"2026-04-01T17:17:53.076Z","avatar_url":"https://github.com/yogyogi.png","language":"C#","funding_links":["https://www.buymeacoffee.com/YogYogi","https://www.paypal.com/paypalme/yogihosting"],"categories":[],"sub_categories":[],"readme":"# ASP.NET Core Unit Testing with xUnit\n\nI perform Unit Testing for my ASP.NET core app with xUnit framework. These are divided into 6 topics:\n\n1. Unit Testing with xUnit in ASP.NET Core\n2. Moq and xUnit for Unit Testing Controllers in ASP.NET Core\n3. Unit Testing of Web API with xUnit and Moq\n4. How to tests Entity Framework Core Codes\n5. How to perform Integration Testing in ASP.NET Core\n6. Automated UI Testing with Selenium in ASP.NET Core\n\nI have also written separate tutorials for each of these 6 types of tests. Kidly refer them.\n\n# Tutorial 1 \n\u003ca href=\"https://www.hosting.work/aspnet-core-xunit-unit-testing/\" target=\"_blank\"\u003eHow to perform Unit Testing with xUnit in ASP.NET Core\u003c/a\u003e \n\n## Contents\n1. Fact, Theory, InlineData\n2. Project Setup\n3. Adding Project for Unit Testing\n4. Adding Project Reference\n5. Adding xUnit Packages\n6. Testing a C# class functionality in xUnit\n7. Arrange, Act, Assert\n8. Running the Test in Test Explorer\n9. [Theory] and [InlineData] attributes\n10. Assert class Important Methods\n11. Testing Controller with xUnit\n12. Writing Test Methods for controllers in xUnit\n13. How to Debug Test Methods with Breakpoints\n\n# Tutorial 2 \n\u003ca href=\"https://www.hosting.work/aspnet-core-moq-xunit-unit-testing/\" target=\"_blank\"\u003eHow to use Moq and xUnit for Unit Testing Controllers in ASP.NET Core\u003c/a\u003e \n\n## Contents\n1. Setup\n2. Moq\n3. In Memory Database\n4. Creating Database Operations Class\n5. Creating a Simple CRUD Operations feature in ASP.NET Core\n6. Testing Controller with Moq and xUnit\n7. Unit Tests for “Create” actions\n8. Unit Tests for “Read” action\n9. Unit Tests for “Update” action\n10. Unit Tests for “Delete” action\n\n# Tutorial 3\n\u003ca href=\"aspnet-core-web-api-xunit-moq-unit-testing\" target=\"_blank\"\u003eUnit Testing of Web API with xUnit and Moq\u003c/a\u003e \n\n## Contents\n1. Project setup install xUnit and Moq\n2. Create Web API\n3. Testing Web API with xUnit and Moq\n\n# Tutorial 4 \n\u003ca href=\"https://www.hosting.work/aspnet-core-xunit-ef-core-unit-testing/\" target=\"_blank\"\u003eHow to tests Entity Framework Core Codes\u003c/a\u003e \n\n## Contents\n1. Setup of the App and In-Memory database for Testing\n2. In Memory Database\n3. Database Context and Model class\n4. Creating a Simple CRUD Operations feature in ASP.NET Core\n5. Testing Controller with xUnit\n6. Seeding the Database\n7. Unit Tests for “Create” actions\n8. Unit Tests for “Read” action\n9. Unit Tests for “Update” action\n10. Unit Tests for “Delete” action\n\n# Tutorial 5\n\u003ca href=\"https://www.hosting.work/aspnet-core-integration-testing/\" target=\"_blank\"\u003eHow to perform Integration Testing in ASP.NET Core\u003c/a\u003e \n\n## Contents\n1. Project Setup\n2. Creating Test Server with WebApplicationFactory\u003cT\u003e class\n3. Integration Test Class\n4. Integration Testing of the Read Action\n5. Integration Testing of the CREATE Action (HTTP GET type)\n6. Invalid Model – Integration Testing of the CREATE Action (HTTP POST type)\n7. Valid Model – Integration Testing of the CREATE Action (HTTP POST type)\n8. AntiForgeryToken in Integration Testing\n9. How to include AntiForgeryToken in Integration Testing\n10. Modify the Integration Test for ValidateAntiForgeryToken\n\n# Tutorial 6 \n\u003ca href=\"https://www.hosting.work/ui-test-selenium-aspnet-core/\" target=\"_blank\"\u003eAutomated UI Testing with Selenium in ASP.NET Core\u003c/a\u003e \n\n## Contents\n1. Project Setup and Selenium Installation\n2. Writing UI tests with Selenium\n3. UI Test to Check if the View is rendered\n4. UI Test to Check browser behaviour when Model is invalid\n5. UI Test to Check browser behaviour for Valid Model\n\n## Want to support me ?\n\nYour support of every $5 will be a great reward for me to carry on my work. Thank you!\n\n\u003ca target=\"_blank\" href=\"https://www.buymeacoffee.com/YogYogi\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" width=\"200\"  style=\"height: 60px !important;width: 200px !important;\" \u003e\u003c/a\u003e\n\u003ca target=\"_blank\" href=\"https://www.paypal.com/paypalme/yogihosting\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/yogyogi/yogyogi/main/paypal.png\" alt=\"Paypal Me\" width=\"300\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyogyogi%2Fasp.net-core-unit-testing-with-xunit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyogyogi%2Fasp.net-core-unit-testing-with-xunit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyogyogi%2Fasp.net-core-unit-testing-with-xunit/lists"}