Skip to content

Finchett.com

A brain dump

  • Home
  • Blog
  • About
  • Kubernetes
  • SQL Server
  • Contact
  • Newsletter
  • Finchett.com Privacy Policy

Tag moq

  • Home
  • Underused Moq Features
9 January 2024

Underused Moq Features

By Stephen in Development Tag c#, moq, unit-testing

Introduction One of the most underused features of Moq, is its ability to handle callbacks and custom method implementations. While many developers are familiar with the basic setup and verification…

Read More

6 January 2024

Using Moq to Verify your Logging is working

By Stephen in Development Tag c#, moq, nunit, unit-testing

Introduction Mocking ILogger<T> for testing methods that use logging in C# can be done effectively using the Moq library. The ILogger<T> interface is commonly used in .NET applications for logging…

Read More

4 January 2024

TDD – Test Driven Development

By Stephen in Development Tag c#, moq, nunit, unit-testing

Introduction Creating a simple calculator class using Test-Driven Development (TDD) in C# involves following the TDD cycle: write a failing test, write just enough code to make the test pass,…

Read More

Search

Table Of Contents
  1. Introduction
  2. Step 1: Set Up the Project Environment
  3. Step 2: Write Your First Test
  4. Step 3: Implement the Feature to Pass the Test
  5. Step 4: Refactor and Repeat
    • Adding More Tests
  6. Advanced Scenario: Using Moq (If Necessary)
  7. Conclusion

Recent Posts

  • Running Proxmox on a Raspberry Pi
  • Honouring .gitignore settings
  • Faker.Net: Data Generation for Developers
  • Exploring MiniExcel: A Lightweight .NET Library for Excel Operations
  • File Path Size Does Matter

apis (4) async (8) c# (103) devops (4) dotnet (5) esp32 (11) git (11) hardware (6) joins (6) kubectl (4) kubernetes (13) logging (4) nanoframework (6) network (8) NFS shares (5) nunit (8) patterns (34) performance (7) pi (8) playwright (7) plugins (8) proxmox (13) serilog (4) setup (16) sql (46) testing (9) tools (6) tslint (4) typescript (23) unit-testing (9) webapi (4)

Archives

Get the Newsletter

Categories

  • Development
  • Infrastructure
  • Other
  • Plugins
  • Raspberry Pi
  • wordpress

Recent Posts

  • Running Proxmox on a Raspberry Pi
  • Honouring .gitignore settings
  • Faker.Net: Data Generation for Developers
  • Exploring MiniExcel: A Lightweight .NET Library for Excel Operations
  • File Path Size Does Matter

Proudly powered by WordPress| Theme: SpicePress Dark by SpiceThemes

We are using cookies to give you the best experience on our website.

You can find out more about which cookies we are using or switch them off in .

Finchett.com
Powered by  GDPR Cookie Compliance
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Strictly Necessary Cookies

Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.