Skip to content

chore: Bump Imposter from 0.2.23 to 1.0.2 - #902

Merged
mergify[bot] merged 1 commit into
mainfrom
dependabot/nuget/Imposter-1.0.2
Oct 18, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
dependabot/nuget/Imposter-1.0.2

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Updated Imposter from 0.2.23 to 1.0.2.

Release notes

Sourced from Imposter's releases.

1.0.2

Fixes

  • Async methods now wait for their callbacks (#​409, closes #​397). For a method returning Task, Task<T>, ValueTask or ValueTask<T>, a callback returns a Task, and that task used to be dropped: an exception in an async callback was never observed, and the call completed before the callback had. Callbacks still start when the method is called, in the order they were added. The task the method returns now completes after the arranged result and every callback that hadn't finished, and fails with the first failure. Callbacks that complete synchronously leave the arranged task unchanged.

    Behaviour change: a test whose async callback fails now sees that failure when it awaits the call.

Maintenance

  • AsyncCallbacks is a new public type in Imposter.Abstractions, for generated code only. It is hidden from IntelliSense.

1.0.1

Fixes

  • Release notes on nuget.org no longer show markdown escape backslashes (#​395, closes #​393). The notes went through a converter that escaped every character that could start markdown, so code such as Arg<int>.Is(5), _ => { } and $GITHUB_OUTPUT reached the package as Arg\<int>, \_ => and $GITHUB\_OUTPUT. A small script in the repository now drops only the markup the notes use, and the package smoke test checks the converted text on every pull request.

No change to the generator or the runtime API.

1.0.0

Imposter 1.0.0 is the first stable release. The package is the same single Imposter package as the 0.2.x line, with the generator and the Imposter.Abstractions runtime inside, and 0.2.27 upgrades to it without code changes.

What 1.0.0 commits to

  • The public API of Imposter.Abstractions: the GenerateImposter attribute, Arg and the span and out matchers, Count, ImposterMode, IHaveImposterInstance<T> with Instance(), and the two exceptions. See the Key API Reference.
  • The fluent setup, verification and event API that generated imposters expose, as documented for methods, properties, indexers and events.
  • The generator runs on Roslyn 4.0 through 5.0 and emits code for C# 8 through C# 14; every release is tested against all four compiler baselines.

TypeCaster, SpanElementsComparer<T> and SetupCollection<T> are public because generated imposters call them, but they are hidden from IntelliSense and may change with the generator in the same package.

Changes since 0.2.27

  • Generated-code helpers are hidden from IntelliSense (#​392, closes #​389). TypeCaster and SpanElementsComparer<T> carry EditorBrowsable(Never) like SetupCollection<T>; the Key API Reference gains an "Imposter Instance" section for IHaveImposterInstance<T> and Instance().
  • The generated _lastestInvocationImposter field is now spelled _latestInvocationImposter (#​394, closes #​390). The field is private to the generated class, so nothing changes for callers.

0.2.27

Maintenance

  • The publish workflow passes the release body straight to the markdown converter (#​391, closes #​388). The copy through $GITHUB_OUTPUT with a fixed EOF delimiter is gone, so a release body that contains a line of exactly EOF can no longer truncate the notes or fail the job. With #​387, this is the first release whose notes reach the package through the file-based path, and it exercises that path end to end. No change to the generator or the runtime API.

0.2.26

Fixes

  • Setups that aren't configured yet no longer hide configured ones (#​383, closes #​381). A method setup took part in matching as soon as its arguments were given, before Returns, Throws or Callback configured it. Until then, a matching call returned the default value or threw MissingImposterException, even when an older setup had an outcome. That could happen in three ways:

    • another thread called while a setup was being added;
    • verifying with narrower arguments created a setup, as in imposter.Get(Arg<int>.Is(5)).Called(Count.Once()), which made later Get(5) calls lose an earlier Returns;
    • a call went through a setup before its first outcome was configured, and that configuration was then lost.

    A call now uses the newest matching setup that has an outcome. A setup without one is used only when nothing configured matches, so a bare void setup still allows its call in explicit mode. Behaviour change: a newer bare setup no longer overrides an older Throws or Callback for the same arguments. To make such a case do nothing, give its setup an empty callback: .Callback(_ => { }).

Maintenance

  • Debug builds of the generator no longer warn about an unused using (#​385, closes #​384). No behaviour change.

0.2.25

Performance

  • Calls no longer allocate to find their setup (#​376, closes #​371). Looking up the matching setup used to enumerate a concurrent stack, which allocated on every call. Setups now live in a SetupCollection<T> that's enumerated without allocating, and the newest matching setup still wins. Bytes per call:

    Call Before After
    method 144 B 96 B
    void method 136 B 88 B
    indexer getter 104 B 56 B
    generic method (1 / 8 setups) 312 / 984 B 168 / 504 B

    SetupCollection<T> is a new public type in Imposter.Abstractions, for generated code only. It's hidden from IntelliSense.

  • Less generator work on every edit (#​377, closes #​370). The generator now chooses each type parameter's generated name once per symbol. It writes types with no renamed type parameter directly. This drops the allocations of the incremental run after an edit by 20% for plain targets and by half for generic ones, and the generated code is unchanged.

Maintenance

  • The README and the docs show a benchmark table that a new workflow regenerates on a GitHub-hosted runner after every change to master (#​380, closes #​379). The docs page no longer labels Moq's results as Imposter's.
  • A generator benchmark (benchmarks/Imposter.GeneratorBenchmarks) measures cold and incremental runs (#​377, #​382, closes #​374).

0.2.24

Fixes

  • Type parameters named await, file, required, scoped or extension (#​378, closes #​369). A target or method type parameter with one of these names made the imposter fail to compile:

    • file and required from C# 11, read as modifiers;
    • extension from C# 14, read as an extension block;
    • scoped from C# 11;
    • await in async methods.

    A type parameter named like any contextual keyword your compiler knows now takes another name in generated code, as var, _, record and partial already did. That covers keywords later compilers add, such as the C# 15 preview's closed and union. You still write the imposter and its setups with your own type arguments, and dedicated namespaces keep the original names.

  • Method type parameters named like members of their generated types (#​373, closes #​349). A generic method whose type parameter was named Invoke, Returns, Matches, As, Callback, Then, Result or another member of the types generated for it failed with CS0102. Such a type parameter now takes another name in generated code; your setups don't change.

Maintenance

  • Regression tests for inherited generic methods whose type parameter is named like the target's (#​368, closes #​350); the fix itself shipped in 0.2.23 with #​362. The generator also lost an unused helper (#​375, closes #​372). The generated imposters behave the same.

Commits viewable in compare view.

@dependabot dependabot Bot added .NET Pull requests that update .NET code dependencies Pull requests that update a dependency file labels Oct 18, 2026
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Test Results

    24 files      24 suites   42m 42s ⏱️
 4 514 tests  4 514 ✅ 0 💤 0 ❌
28 680 runs  28 680 ✅ 0 💤 0 ❌

Results for commit 5a85531.

♻️ This comment has been updated with latest results.

---
updated-dependencies:
- dependency-name: Imposter
  dependency-version: 1.0.2
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot
dependabot Bot force-pushed the dependabot/nuget/Imposter-1.0.2 branch from 5311dd4 to 5a85531 Compare October 18, 2026 18:49
@mergify
mergify Bot merged commit bb72014 into main Oct 18, 2026
16 checks passed
@mergify
mergify Bot deleted the dependabot/nuget/Imposter-1.0.2 branch October 18, 2026 20:37
@github-actions

Copy link
Copy Markdown

👽 Mutation Results

Mutation testing badge

Mockolate

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Runtime Errors Total Detected Total Undetected Total Mutants

The final mutation score is NaN%

Coverage Thresholds: high:80 low:60 break:0

@github-actions

Copy link
Copy Markdown

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.5 LTS (Noble Numbat)
INTEL XEON PLATINUM 8573C 3.00GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.303
[Host] : .NET 10.0.13 (10.0.13, 10.0.1326.50504), X64 RyuJIT x86-64-v4

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Method N Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 1 377.9 ns 10.49 ns 9.81 ns 0.84 1.93 KB 1.00
Mockolate 1 451.9 ns 2.97 ns 2.63 ns 1.00 1.93 KB 1.00
Imposter 1 712.6 ns 11.41 ns 10.12 ns 1.58 3.99 KB 2.07
TUnitMocks 1 579.6 ns 4.60 ns 4.08 ns 1.28 2.04 KB 1.06
Moq 1 88,946.9 ns 305.37 ns 285.65 ns 196.82 14.55 KB 7.54
NSubstitute 1 5,772.1 ns 23.49 ns 20.82 ns 12.77 9.12 KB 4.72
FakeItEasy 1 4,815.7 ns 22.63 ns 21.17 ns 10.66 8.06 KB 4.18
baseline* 10 684.1 ns 19.95 ns 18.66 ns 0.77 2.14 KB 1.00
Mockolate 10 888.5 ns 1.80 ns 1.68 ns 1.00 2.14 KB 1.00
Imposter 10 1,043.0 ns 13.02 ns 12.17 ns 1.17 4.84 KB 2.26
TUnitMocks 10 1,789.4 ns 4.92 ns 4.36 ns 2.01 3.75 KB 1.75
Moq 10 96,020.6 ns 425.37 ns 397.89 ns 108.07 18.46 KB 8.63
NSubstitute 10 8,402.3 ns 33.37 ns 29.58 ns 9.46 12.07 KB 5.64
FakeItEasy 10 8,134.5 ns 46.10 ns 43.12 ns 9.15 15.42 KB 7.20
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.5 LTS (Noble Numbat)
AMD EPYC 7763 3.11GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.303
[Host] : .NET 10.0.13 (10.0.13, 10.0.1326.50504), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Event Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 169.63 ns 4.339 ns 4.059 ns 0.56 1.7 KB 1.00
Mockolate 303.2 ns 10.49 ns 9.82 ns 1.00 1.7 KB 1.00
Imposter 922.6 ns 11.31 ns 10.58 ns 3.05 7.18 KB 4.22
TUnitMocks 184.0 ns 2.36 ns 2.21 ns 0.61 1.36 KB 0.80
Moq 16,507.1 ns 115.39 ns 107.93 ns 54.49 12.73 KB 7.47
NSubstitute 5,766.1 ns 24.72 ns 23.12 ns 19.04 9.05 KB 5.31
FakeItEasy 216,814.0 ns 730.09 ns 609.66 ns 715.74 15.26 KB 8.96
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.5 LTS (Noble Numbat)
AMD EPYC 9V74 3.69GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.303
[Host] : .NET 10.0.13 (10.0.13, 10.0.1326.50504), X64 RyuJIT x86-64-v4

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Callback Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 215.7 ns 5.42 ns 4.81 ns 0.89 1.57 KB 1.00
Mockolate 242.6 ns 3.86 ns 3.42 ns 1.00 1.57 KB 1.00
Imposter 339.7 ns 6.04 ns 5.65 ns 1.40 2.34 KB 1.49
TUnitMocks 438.9 ns 8.20 ns 7.27 ns 1.81 2.02 KB 1.28
Moq 55,887.4 ns 239.48 ns 224.01 ns 230.38 8.88 KB 5.66
NSubstitute 3,534.0 ns 36.28 ns 33.94 ns 14.57 7.71 KB 4.91
FakeItEasy 3,667.0 ns 61.53 ns 57.55 ns 15.12 6.81 KB 4.33
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.5 LTS (Noble Numbat)
AMD EPYC 7763 3.06GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.303
[Host] : .NET 10.0.13 (10.0.13, 10.0.1326.50504), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Indexer N Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 1 921.1 ns 22.93 ns 21.44 ns 0.94 3.77 KB 1.00
Mockolate 1 984.9 ns 21.14 ns 19.77 ns 1.00 3.77 KB 1.00
Imposter 1 869.2 ns 12.12 ns 10.75 ns 0.88 4.95 KB 1.32
Moq 1 220,577.7 ns 1,399.06 ns 1,308.68 ns 224.03 20.25 KB 5.38
NSubstitute 1 10,477.7 ns 65.46 ns 58.02 ns 10.64 12.84 KB 3.41
FakeItEasy 1 12,752.2 ns 57.07 ns 50.60 ns 12.95 13.63 KB 3.62
baseline* 10 2,396.3 ns 12.49 ns 11.68 ns 0.94 4.82 KB 1.00
Mockolate 10 2,559.4 ns 22.38 ns 20.94 ns 1.00 4.82 KB 1.00
Imposter 10 1,444.5 ns 17.25 ns 16.14 ns 0.56 6.01 KB 1.25
Moq 10 232,280.1 ns 407.29 ns 361.06 ns 90.76 28.64 KB 5.94
NSubstitute 10 27,102.3 ns 105.66 ns 93.66 ns 10.59 25.63 KB 5.32
FakeItEasy 10 25,890.9 ns 144.33 ns 127.95 ns 10.12 32.97 KB 6.84
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.5 LTS (Noble Numbat)
AMD EPYC 7763 2.94GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.303
[Host] : .NET 10.0.13 (10.0.13, 10.0.1326.50504), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

CreateMock Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 20.91 ns 1.009 ns 0.944 ns 1.11 160 B 1.00
Mockolate 18.77 ns 0.371 ns 0.329 ns 1.00 160 B 1.00
Imposter 288.34 ns 4.508 ns 4.217 ns 15.37 2240 B 14.00
TUnitMocks 39.11 ns 0.459 ns 0.407 ns 2.08 216 B 1.35
Moq 1,500.10 ns 11.811 ns 10.470 ns 79.95 2096 B 13.10
NSubstitute 2,065.78 ns 9.629 ns 9.007 ns 110.10 5048 B 31.55
FakeItEasy 1,852.27 ns 10.021 ns 9.373 ns 98.72 2763 B 17.27
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.5 LTS (Noble Numbat)
AMD EPYC 7763 2.45GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.303
[Host] : .NET 10.0.13 (10.0.13, 10.0.1326.50504), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Property N Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 1 593.3 ns 11.87 ns 11.10 ns 0.92 2.41 KB 1.00
Mockolate 1 644.7 ns 10.99 ns 10.28 ns 1.00 2.41 KB 1.00
Imposter 1 445.3 ns 3.61 ns 3.20 ns 0.69 2.98 KB 1.23
TUnitMocks 1 492.1 ns 2.87 ns 2.68 ns 0.76 1.66 KB 0.69
Moq 1 12,165.1 ns 67.15 ns 59.53 ns 18.87 10.47 KB 4.34
NSubstitute 1 8,100.2 ns 20.43 ns 18.11 ns 12.57 11.45 KB 4.74
FakeItEasy 1 8,848.7 ns 80.61 ns 71.46 ns 13.73 11.24 KB 4.66
baseline* 10 959.2 ns 15.07 ns 14.09 ns 0.91 2.91 KB 1.00
Mockolate 10 1,053.8 ns 2.99 ns 2.79 ns 1.00 2.91 KB 1.00
Imposter 10 680.4 ns 3.10 ns 2.90 ns 0.65 3.26 KB 1.12
TUnitMocks 10 1,662.9 ns 5.71 ns 5.06 ns 1.58 3.95 KB 1.36
Moq 10 19,534.3 ns 59.69 ns 52.91 ns 18.54 18.36 KB 6.32
NSubstitute 10 19,296.3 ns 100.56 ns 83.97 ns 18.31 21.08 KB 7.25
FakeItEasy 10 22,033.4 ns 69.51 ns 61.61 ns 20.91 30.81 KB 10.60

baseline* rows show the corresponding Mockolate benchmark from the most recent successful main branch build with results, for regression comparison.

github-actions Bot added a commit that referenced this pull request Oct 19, 2026
github-actions Bot added a commit that referenced this pull request Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file .NET Pull requests that update .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants