{
    "content": "<h1>Overview of <a href=\"..\/NSubstitute\/\">NSubstitute<\/a><\/h1><p><a href=\"..\/NSubstitute\/\">NSubstitute<\/a> is a popular mocking framework designed for <a href=\"..\/.NET\/\">.NET<\/a> developers. It serves as a tool for creating <a href=\"..\/Mock-Objects\/\">Mock-Objects<\/a> in <a href=\"..\/Unit-Testing\/\">Unit-Testing<\/a> environments, emphasizing a syntax that is easy to read and write. By utilizing <a href=\"..\/C-Sharp\/\">C#<\/a> extension methods, <a href=\"..\/NSubstitute\/\">NSubstitute<\/a> allows developers to define expected behavior and verify method calls without the boilerplate code often associated with other libraries like <a href=\"..\/Moq\/\">Moq<\/a>.<\/p><p>When using the <a href=\"..\/NSubstitute\/\">NSubstitute<\/a> <a href=\"..\/API\/\">API<\/a>, the core workflow involves substituting an <a href=\"..\/Interface\/\">Interface<\/a> or class using <code>Substitute.For&lt;T&gt;()<\/code>. Developers can then configure return values using the <code>Returns()<\/code> method. For complex scenarios, the <a href=\"..\/Arg\/\">Arg<\/a> utility enables flexible argument matching, such as <code>Arg.Is&lt;int&gt;(x => x > 0)<\/code>. Verification of behavior is achieved through the <code>Received()<\/code> and <code>DidNotReceive()<\/code> methods, ensuring that the <a href=\"..\/Software-Architecture\/\">Software-Architecture<\/a> remains robust through verified interactions.<\/p><p>Resources for further learning include the <a href=\"https:\/\/nsubstitute.github.io\/\">NSubstitute Official Documentation<\/a> and the project source on <a href=\"https:\/\/github.com\/nsubstitute\/NSubstitute\">GitHub<\/a>. It is widely considered a standard tool for <a href=\"..\/Test-Driven-Development\/\">Test-Driven-Development<\/a> within the ecosystem.<\/p><ul><li><a href=\"..\/Unit-Testing\/\">Unit-Testing<\/a><\/li><li><a href=\"..\/Dependency-Injection\/\">Dependency-Injection<\/a><\/li><li><a href=\"..\/Mocking-Frameworks\/\">Mocking-Frameworks<\/a><\/li><li><a href=\"..\/Test-Driven-Development\/\">Test-Driven-Development<\/a><\/li><\/ul>",
    "tags": [
        "nsubstitute",
        "mocking",
        "dotnet",
        "unit-testing",
        "csharp",
        "api",
        "test-doubles",
        "tdd",
        "software-testing",
        "programming"
    ]
}