Skip to content

Commit

Permalink
Merge pull request #1275 from stakx/records
Browse files Browse the repository at this point in the history
Upgrade DynamicProxy to version 5.1.0 for better `record` type support
  • Loading branch information
stakx committed Aug 2, 2022
2 parents e2460df + 6878a90 commit 4ab6ce1
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
The format is loosely based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).


## Unreleased

#### Changed

* Update package reference to `Castle.Core` (DynamicProxy) from version 5.0.0 to 5.1.0 (@stakx, #1275)

#### Fixed

* Throws `TypeLoadException` on mock when a record has a base record on .NET 6 (@tgrieger-sf, #1273)


## 4.18.1 (2022-05-16)

#### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/Moq/Moq.csproj
Expand Up @@ -43,7 +43,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Castle.Core" Version="5.0.0" />
<PackageReference Include="Castle.Core" Version="5.1.0" />
<PackageReference Include="IFluentInterface" Version="2.1.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="TypeNameFormatter.Sources" Version="1.0.0" PrivateAssets="All" />
Expand Down
4 changes: 2 additions & 2 deletions tests/Moq.Tests/Moq.Tests.csproj
Expand Up @@ -10,7 +10,7 @@
<DebugSymbols>True</DebugSymbols>
<DebugType>portable</DebugType>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<LangVersion>8.0</LangVersion>
<LangVersion>9.0</LangVersion>
<IsPackable>False</IsPackable>
<NoWarn>$(NoWarn);CS8032</NoWarn>
</PropertyGroup>
Expand All @@ -23,7 +23,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Castle.Core" Version="5.0.0" />
<PackageReference Include="Castle.Core" Version="5.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.9" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
Expand Down
30 changes: 30 additions & 0 deletions tests/Moq.Tests/RecordsFixture.cs
@@ -0,0 +1,30 @@
// Copyright (c) 2007, Clarius Consulting, Manas Technology Solutions, InSTEDD, and Contributors.
// All rights reserved. Licensed under the BSD 3-Clause License; see License.txt.

using Xunit;

namespace Moq.Tests
{
public class RecordsFixture
{
[Fact]
public void Can_mock_EmptyRecord()
{
_ = new Mock<EmptyRecord>().Object;
}

[Fact]
public void Can_mock_DerivedEmptyRecord()
{
_ = new Mock<DerivedEmptyRecord>().Object;
}

public record EmptyRecord
{
}

public record DerivedEmptyRecord : EmptyRecord
{
}
}
}

0 comments on commit 4ab6ce1

Please sign in to comment.