Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

InvalidOperationException with init properties
MihaMarkic
#1 Posted : Friday, November 20, 2020 10:20:38 AM(UTC)
Rank: Member

Groups: Registered
Joined: 5/8/2015(UTC)
Posts: 16
Location: Slovenia

Thanks: 3 times
Was thanked: 2 time(s) in 2 post(s)
Hi guys,

I'm seeing an InvalidProgramException being thrown when assigning a init property to a record or a class.
Both test project and testee are .Net 5.

Quote:

public record ApsProperty
{
public string Name { get; init; }
}


And code in test project is like this:

Quote:

var expected2 = new ApsProperty
{
Name = "ClientFormId",
};


It happens at ApsProperty.set_Name(String value) according to call stack;
Remco
#2 Posted : Friday, November 20, 2020 10:55:35 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, we have a fix pending for this in the build here - https://forum.ncrunch.net/yaf_postst3047_Problem-with-dotnet-5.aspx
2 users thanked Remco for this useful post.
MihaMarkic on 11/20/2020(UTC), ovation22 on 11/21/2020(UTC)
MihaMarkic
#3 Posted : Friday, November 20, 2020 11:06:18 AM(UTC)
Rank: Member

Groups: Registered
Joined: 5/8/2015(UTC)
Posts: 16
Location: Slovenia

Thanks: 3 times
Was thanked: 2 time(s) in 2 post(s)
Yep, that does the trick.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.026 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download