Closed robertcoltheart closed 3 years ago
AMAZING. Happy to try out the preview if you publish it to nuget.
Using Rider 2020.3
I assume this is because I am mixing versions
<PackageReference Include="Machine.Specifications" Version="1.0.1-PullRequest0426.255" />
<PackageReference Include="Machine.Specifications.Runner.VisualStudio" Version="2.10.1" />
gives:
TestRunner: Application JetBrains.Rd.Tasks.RdFault: Constructor on type 'Machine.Specifications.Runner.Impl.DefaultRunner' not found., reason: System.MissingMethodException: Constructor on type 'Machine.Specifications.Runner.Impl.DefaultRunner' not found.
Server stack trace:
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(String assemblyString, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)
at System.AppDomain.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
at Machine.Specifications.Runner.Utility.AppDomainRunner.CreateRunnerInSeparateAppDomain(AppDomain appDomain, AssemblyPath assembly)
@mikeblakeuk This was a bug in the Rider MSpec plugin. Update your plugin and it should work.
Looks like net 4.6.2 tests don't work but net 5.0 ones do...
In VS with net 4.6.2, (4.7.2 & 5.0 works)
System.Runtime.Serialization.SerializationException: Type 'Machine.Specifications.ExceptionResult' in Assembly 'Machine.Specifications, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.
Ignore the error, this has to be back-ported into 1.0 for it to work. Will release off the 1.0.0
branch.
I assume a version will appear on NuGet soon https://www.nuget.org/packages/Machine.Specifications/
Released as v1.1.0-beta.1
, try it out and let me know how it goes.
Looks like you can't mix sync with async
Could be the version of MSpec i was using, sorry (I was using a pull request version!)
Ok, please confirm if this works with the beta. There is a unit test that covers this, so it should work.
Fixed #293
This is inspired by the xUnit strategy for executing
async void
methods.This lets you run specs using the following syntax: