fluffynuts / NExpect

An assertions framework for .NET with a BDD-like feel, inspired by Chai and Jasmine, designed to be user-extensible
BSD 3-Clause "New" or "Revised" License
22 stars 8 forks source link

Expect type to equal type hanging MS & Resharper test runners in DotNetCore 2.0 #12

Closed brendon1982 closed 6 years ago

brendon1982 commented 6 years ago

With: DotNetCore 2.0 NUnit 3.9.0 Visual Studio 2017 15.5.1

The following expectation will hang both MS and Resharper test runners (on my machine ;D):

Expect(new Object().GetType()).To.Equal(typeof(Object));

fluffynuts commented 6 years ago

This issue is specific to dotnet core: turns out types are enumerable on dnc, so the Stringifier attempts to create a string representation of it and linked properties -- ending up trying to stringify the entire app domain. I've added a type-specific Stringify special case (go, go strategies!) which uses the venerable PeanutButter {Type}.PrettyName() extension to get a fully-qualified name for the type.

Issue is resolved in package 1.0.97.