Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/stefruseva88/unit-tests-mocks

Unit-testing, decoupling, mocking with Moq framework in C#
https://github.com/stefruseva88/unit-tests-mocks

decoupling moq-framework nunit-tests unit-testing

Last synced: about 2 months ago
JSON representation

Unit-testing, decoupling, mocking with Moq framework in C#

Awesome Lists containing this project

README

        

# Unit Testing with Mocking
[![C#](https://img.shields.io/badge/Made%20with-C%23-239120.svg)](https://learn.microsoft.com/en-us/dotnet/csharp/)
[![.NET](https://img.shields.io/badge/.NET-5C2D91.svg)](https://dotnet.microsoft.com/)
[![Moq](https://img.shields.io/badge/tested%20with-Moq-6DB33F.svg)](https://github.com/moq)
[![NUnit](https://img.shields.io/badge/tested%20with-NUnit-22B2B0.svg)](https://nunit.org/)

### This is a test project for **Back-End Tehnologies** January 2024 Course @ SoftUni
---

## Project Description
This repository showcases several test projects designed to demonstrate essential techniques in back-end testing. The focus is primarily on unit testing, decoupling, and using the Moq framework for mocking dependencies in C#.

## Core Concepts
- **Unit Testing:** Testing individual units of code in isolation to ensure they function as expected.
- **Decoupling:** Minimizing dependencies between system components, enabling easier testing and greater modularity.
- **Mocking:** Leveraging the Moq framework to create mock objects that simulate real dependencies, allowing for controlled testing scenarios.

## Technologies Used
- **Moq:** A powerful and flexible mocking framework for .NET that simplifies creating test doubles.
- **NUnit:** A widely used testing framework for writing and running tests in .NET environments.

## Projects in the Repository
### 1. GetGreeting Project
- **GetGreeting.Tests:** Contains unit tests designed to validate the functionality of the GetGreeting application.
- **GetGreeting:** The main application project responsible for generating personalized greetings.

### 3. ItemManagement Project
- **ItemManagementApp:** The main application logic for managing items, including adding, updating, and removing items.
- **ItemManagementLib:** A shared library that contains the core functionalities used by the ItemManagementApp.
- **ItemManagementTests:** A collection of unit tests written to validate the behavior and functionality of the ItemManagement project.

## Requirements
To run and modify these test projects, you’ll need:

- .NET 6.0 SDK or higher
- Visual Studio 2022 or later / Visual Studio Codee

## License
This project is licensed under the [MIT License](LICENSE). See the [LICENSE](LICENSE) file for details.

## Contact
For any questions or suggestions, please reach out to me or open an issue in the repository.

---
### Happy Testing! 🚀