Browse
Login Sign Up

.NET Coded Unit and Integration Test with xUnit, MoQ and Repository Pattern -

Share & earn cash

In the deliverables, you will find source code for the project and the supporting database backup file. You need to restore the database backup on Sql Server 2005 or higher. You will need Visual Studio 2017 or higher to load the project/solution see the code and run it.

The solution contains 3 projects -
. FoodSample [the project containing the core business logic to be tested, implemented with Repository Code Pattern]

. FoodSample.Tests [test project written with xUnit and MoQ]

. FoodSample.API [optional webAPI project upon which student can experiment, implement and run different webAPI requests to see for himself]


When we implement a Repository Pattern of data abstraction and loose coupling in applications, MoQ and xUnit become imperative, in order to 'Mock' that interface and its member methods. 'Mocking' is the only way and therein lies the importance of MoQ. In the project, you would find IDatSource as the interface containing the method, whose implementation is inside the FoodDataSource and that method is precisely the one which we want to test by supplying it various parameters. Find that part of the coded test in the FoodSampleTest class of the FoodSample.Tests project. Both xUnit and MoQ packages are added to the project, through the Nuget package manager.

In order to fully understand the solution, the student is requested to read and research a little bit on the following

- C# Repository Pattern

- concept of C# Coded Tests

- xUnit and Mocking of Interfaces

- concepts of nUnit Testing



License type: "1 paid end product". Read more.
By Pro_indigo
.net Testing C#.net Xunit Moq Repositorypattern
Reviews
Nobody has rated this offer yet.
PARTICIPATE
  • Buy
  • Offer
  • Share
LEARN
  • About
  • Blog
  • FAQ
CONNECT
  • Twitter
  • Facebook
  • Contact
LEGAL
  • Terms
  • Privacy
  • © 2025 Sellcodes
Log in to your Sellcodes account
Forgot your password?
Looking to create an account?
Sign up for Sellcodes
By creating an account you agree to our Terms Of Use and Privacy Policy
Did you mean to Login?