Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Docs/pages/00-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@ Framework 4.8.

## Getting Started

1. Install the [`Mockolate`](https://www.nuget.org/packages/Mockolate) nuget package
1. Check prerequisites
Although Mockolate supports multiple .NET Standard 2.0 compatible frameworks (including .NET Framework 4.8), you must
have the [.NET 10 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/10.0) installed to build and compile
Mockolate. This is required because Mockolate
leverages [C# 14 extension members](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/extension-methods#declare-extension-members).

2. Install the [`Mockolate`](https://www.nuget.org/packages/Mockolate) nuget package
```ps
dotnet add package Mockolate
```

2. Create and use the mock
3. Create and use the mock
```csharp
using Mockolate;

Expand Down
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,27 @@
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FaweXpect%2FMockolate%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/aweXpect/Mockolate/main)

**Mockolate** is a modern, strongly-typed, AOT-compatible mocking library for .NET, powered by source generators. It
enables fast,
compile-time validated mocks for interfaces and classes, supporting .NET Standard 2.0, .NET 8, .NET 10, and .NET
Framework 4.8.
enables fast, compile-time validated mocks for interfaces and classes, supporting .NET Standard 2.0, .NET 8, .NET 10,
and .NET Framework 4.8.

- **Source generator-based**: No runtime proxy generation, fast and reliable.
- **Strongly-typed**: Setup and verify mocks with full IntelliSense and compile-time safety.
- **AOT compatible**: Works with NativeAOT and trimming.

## Getting Started

1. Install the [`Mockolate`](https://www.nuget.org/packages/Mockolate) nuget package
1. Check prerequisites
Although Mockolate supports multiple .NET Standard 2.0 compatible frameworks (including .NET Framework 4.8), you must
have the [.NET 10 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/10.0) installed to build and compile
Mockolate. This is required because Mockolate
leverages [C# 14 extension members](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/extension-methods#declare-extension-members).

2. Install the [`Mockolate`](https://www.nuget.org/packages/Mockolate) nuget package
```ps
dotnet add package Mockolate
```

2. Create and use the mock
3. Create and use the mock
```csharp
using Mockolate;

Expand Down Expand Up @@ -140,8 +145,8 @@ var classMock = Mock.Create<MyChocolateDispenser>(
- You can provide custom default values for specific types using `.WithDefaultValueFor<T>()`:
```csharp
var behavior = MockBehavior.Default
.WithDefaultValueFor<string>(() => "default")
.WithDefaultValueFor<int>(() => 42);
.WithDefaultValueFor<string>(() => "default")
.WithDefaultValueFor<int>(() => 42);
var sut = Mock.Create<IChocolateDispenser>(behavior);
```
This is useful when you want mocks to return specific default values for certain types instead of the standard
Expand Down
Loading