Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade DynamicProxy to version 5.1.0 for better record type support #1275

Merged
merged 3 commits into from Aug 2, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
{
}
}
}