NullReferenceException thrown during testFromAssembly
See original GitHub issueI’m getting a nullref exception during testFromAssembly
. Full stacktrace:
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicFunctions.UnboxGeneric[T](Object source)
at Expecto.Impl.getTestFromMemberInfo@1138-1.Invoke(a focusedState)
at Microsoft.FSharp.Core.OptionModule.Map[T,TResult](FSharpFunc`2 mapping, FSharpOption`1 option)
at Expecto.Impl.testFromMember(MemberInfo mi)
at Microsoft.FSharp.Collections.Internal.IEnumerator.choose@165.System-Collections-IEnumerator-MoveNext()
at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
at Expecto.Impl.testFromType@1167.Invoke(Type t)
at Microsoft.FSharp.Collections.Internal.IEnumerator.choose@165.System-Collections-IEnumerator-MoveNext()
at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
at Expecto.Impl.testFromAssemblyWithFilter(FSharpFunc`2 typeFilter, Assembly a)
at YoloDev.Expecto.TestSdk.Discovery.discoverTests@143.GenerateNext(IEnumerable`1& next) in /Users/alxandr/hub/YoloDev.Expecto.TestSdk/src/YoloDev.Expecto.TestSdk/adapter.fs:line 149
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()
at Microsoft.FSharp.Collections.SeqModule.Iterate[T](FSharpFunc`2 action, IEnumerable`1 source)
at YoloDev.Expecto.TestSdk.VsTestAdapter.Microsoft-VisualStudio-TestPlatform-ObjectModel-Adapter-ITestDiscoverer-DiscoverTests(IEnumerable`1 sources, IDiscoveryContext discoveryContext, IMessageLogger logger, ITestCaseDiscoverySink discoverySink) in /Users/alxandr/hub/YoloDev.Expecto.TestSdk/src/YoloDev.Expecto.TestSdk/adapter.fs:line 200
Running on dotnet core 2.0 on OSX
Issue Analytics
- State:
- Created 6 years ago
- Comments:22 (13 by maintainers)
Top Results From Across the Web
Detecting what the target object is when ...
As a few answers have pointed out, tell Visual Studio to break on Throw for NullReferenceException. How to tell VS to break when...
Read more >How can I fix the error: System.NullReferenceException
A NullReferenceException exception is thrown when you try to access a member on a type whose value is null. A NullReferenceException exception ......
Read more >NullReferenceException Class (System)
The exception that is thrown when there is an attempt to dereference a null object reference.
Read more >How to avoid NullReferenceException in C# | RIMdev Blog
This exception is thrown when you try to access any properties / methods/ indexes on a type of object which points to null....
Read more >Object Reference Not Set to an Instance of an Object
This infamous and dreaded error message happens when you get a NullReferenceException. This exception is thrown when you try to access a member—for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Btw; I have a (seemingly) working runner for vstest (the new one) available at https://github.com/YoloDev/YoloDev.Expecto.TestSdk. Let me know if this is something you’re interested in adopting.
Also, if you’re not, I’m using a bunch of “internal” (
Expect.Impl
) apis, and I don’t see how I could not currently, so Expecto might need a bigger API surface ifExpecto.Impl
is not supposed to be used.It’s currently in a very early state. It does not support filters or any such. Need to figure out how that works first.
Closing and opening a new issue for this. Thanks