Burla.Core 1.0.0

dotnet add package Burla.Core --version 1.0.0
                    
NuGet\Install-Package Burla.Core -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Burla.Core" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Burla.Core" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Burla.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Burla.Core --version 1.0.0
                    
#r "nuget: Burla.Core, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Burla.Core@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Burla.Core&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Burla.Core&version=1.0.0
                    
Install as a Cake Tool

Burla 🎭

NuGet version NuGet downloads

mocking without the nonsense

Burla ("prank" in Italian) is a lightweight, LLM‑friendly mocking library for .NET. It is built for explicit tests, strict defaults, and real migrations between mocking styles and libraries. Its API stays focused and predictable: setup, argument matching, and verification follow consistent patterns, so humans can read tests quickly and LLMs can spend their context on the code under test instead of mock-library quirks. Start with one awkward test, see how it reads, and use the migration guides when you want to scale up. Burla stays free forever. Yes, really. No prank this time.

Install from NuGet with dotnet add package Burla.

Why Burla?

Pain Point Moq NSubstitute Burla
IAsyncEnumerable Helper methods needed Helper methods needed First-class support
Ref/Out parameters Verbose delegates Limited support Clean syntax
Strict mode Opt-in ❌ Default βœ…
Thread safety ❌ ❌ Built-in βœ…
Runtime instance access βœ… (.Object) direct substitute βœ… (.Instance; .Object compatibility alias)
Clear verification βœ… βœ… βœ…

Quick Start

// Create a mock
var mock = Mock.Of<ICalculator>();

// Setup behavior
mock.Setup(x => x.Add(Arg.Any<int>(), Arg.Any<int>())).Returns(42);

// Use it
var result = mock.Instance.Add(1, 2); // returns 42

// Verify calls - use standard xUnit assertions!
var calls = mock.CallsTo(x => x.Add(1, 2));
Assert.Single(calls);  // called exactly once

This "query and assert" pattern (inspired by MELT) is the Burla-native verification style. Verify(...) and Times remain available mainly for low-diff Moq migrations and for VerifyNoOtherCalls().

Burla-native docs use .Instance as the everyday spelling for the runtime double. .Object stays available as a compatibility alias for Moq-style code and migration work. Burla also ships with analyzer/code fixes grouped into BURLA01x compatibility nudges and BURLA02x correctness checks. Today that means .Object β†’ .Instance (BURLA010), It.* β†’ Arg.* (BURLA011), SetupGet(...) β†’ Setup(...) (BURLA012), and a quick fix for forgotten zero-argument Times parentheses in Verify(...) (BURLA020). If you are migrating a large Moq codebase and want less noise, lower the compatibility rules BURLA010, BURLA011, and BURLA012 to silent or none in .editorconfig.

Most users can just install Burla and go. If you need something more specialized, Burla.Core is the runtime-only package and Burla.Analyzers is available on its own for suggestion/code-fix-only installs.

If you only need the runtime instance and not the wrapper later, especially in setup-only or NSubstitute-style tests, Mock.Create<T>() and Mock.CreateLoose<T>() return it directly. Compatibility sugar such as It, SetupGet(...), .Object, and Verify(..., Times...) exists for low-friction migrations, while the main docs keep teaching Arg, Setup(...), .Instance, SetsByRefParameter(...), Event(...).Emit(...), and CallsTo(...) + standard assertions first.

Native API at a glance

Burla's 1.0 surface stays focused:

  • create mocks with Mock.Of<T>() / Mock.OfLoose<T>(), or return the runtime value directly with Mock.Create<T>() / Mock.CreateLoose<T>()
  • use mock.Instance as the runtime dependency
  • configure behavior with Setup(...) / SetupSet(...)
  • match arguments with Arg.*
  • verify through CallsTo(...) + standard assertions, with Verify(..., Times...) and VerifyNoOtherCalls() available when they help
  • order calls with Mock.Sequence() / .InSequence(...) when sequencing matters
  • configure ref / out behavior with Arg.Ref<T>.Any plus SetsByRefParameter(index, value)
  • emit events with mock.Event(name).Emit(...)
  • clear mutable state with mock.Reset()

For low-friction migration, Burla also keeps a thin compatibility layer: .Object, It.*, and SetupGet(...). The default analyzers surface those as BURLA010, BURLA011, and BURLA012, while BURLA020 fixes forgotten () on zero-argument Times factories inside Verify(...).

Documentation

πŸ“– Full documentation β€” Getting started, API guide, and migration guides.

If you're evaluating Burla from a Moq or NSubstitute codebase, start with the migration guides and the LLM migration reference before broad rewrites.

What Burla 1.0 covers

Burla 1.0 covers the mocking workflows most .NET teams need in day-to-day test suites, with a focused API that stays easy to learn, easy to read in reviews, and practical to adopt in existing codebases.

  • interfaces, abstract classes, and concrete classes with virtual members
  • strict-by-default and loose mock behavior
  • async methods and streams, sequences, events, and ref / out writeback
  • call inspection, ordered verification, and reset support
  • compatibility aliases, analyzers, and migration guides for Moq or NSubstitute users

It focuses on the patterns most teams hit every day. One notable advanced case still out of scope for 1.0 is protected-member setup.

Design notes

For maintainers, contributors, and curious evaluators, the design folder captures background rationale and focused design notes:

License

MIT - Free forever. No pranks here. 🀝

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Burla.Core:

Package Downloads
Burla

The default Burla package. Includes Burla.Core plus Burla.Analyzers for migration-friendly IDE suggestions.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 106 4/30/2026