jcansdale / TestDriven.Net-Issues

Issue tracking for TestDriven.Net
https://github.com/jcansdale/TestDriven.Net-Issues/issues
24 stars 2 forks source link

Could not "run tests" from method with ValueTuple in args #137

Closed sm-g closed 5 years ago

sm-g commented 5 years ago
[TestCaseSource(nameof(ValidationChecks_ShouldBeInExpectedOrderCases))]
public async Task ValidationChecks_ShouldBeInExpectedOrder(
    Action<Mock<IMediator>> mediatorSetup,
    (int one, int two) calls)
{
    Assert.Fail();
}

when cursor inside this method, "run tests" gives

Test 'M:My.SutTests.ValidationChecks_ShouldBeInExpectedOrder(System.Action{Moq.Mock{MediatR.IMediator}},(System.Int32one,System.Int32two))' failed:
    Couldn't find declaring type with name 'My.SutTests.ValidationChecks_ShouldBeInExpectedOrder(System.Action{Moq.Mock{MediatR'
    System.Exception: Couldn't find declaring type with name 'My.SutTests.ValidationChecks_ShouldBeInExpectedOrder(System.Action{Moq.Mock{MediatR'
    at MutantDesign.Xml.Documentation.MemberInfoUtilities.FindMemberInfo(Assembly assembly, String cref)
    at TestDriven.TestRunner.AdaptorTestRunner.Run(ITestListener testListener, ITraceListener traceListener, String assemblyPath, String testPath)
    at TestDriven.TestRunner.ThreadTestRunner.Runner.Run()

But tests executed when "run tests" done for whole tests fixture class.

VS 15.8.2 TD 4.3 test project is

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net461</TargetFramework>
  </PropertyGroup>
jcansdale commented 5 years ago

@sm-g πŸ‘‹ Sorry I missed this when it came in. I'll investigate!

jcansdale commented 5 years ago

@sm-g,

Sorry about the delay getting to this. My biggest challenge was updating some old integration tests to run with Visual Studio 2017. Integration testing is still hard. 😭

Could you try this version: TestDriven.VSPackage_ValueTuple.zip

It should work with un-nested value tuples. For example, (int, int), (int x, int y) should work, but currently ((int x, int y), (string a, string b)) won't work.

Please let me know how you get on. πŸ™ If it does work, see if you can break it. πŸ˜‰

sm-g commented 5 years ago

@jcansdale Will this vsix work side by side with currently installed?

jcansdale commented 5 years ago

Will this vsix work side by side with currently installed?

Good question. The version I gave you won't work side by side with the installed version. I've been wondering what to do about this. It does add complexity, but forcing people to uninstall would be inconvenient. This would also be a problem for anyone that wanted to use a pre-2015 version of Visual Studio (which the VSIX installer doesn't support).

Here is a new version that you can install over the top of any EXE/MSI based version: TestDriven.VSPackage_ValueTuple_Experimental.zip

I'm interested to know which versions of Visual Studio do you still use?

jcansdale commented 5 years ago

@sm-g,

Here's a version with more complete value tuple support. It should be to cope with nested value tuples and value tuples combined with generic types (e.g. Func<(int,int)>).

TestDriven.VSPackage_ValueTuple.zip

sm-g commented 5 years ago

@jcansdale I am using latest possible VS.

I have tested this 4.4.18089.980 version, it works. But if I want to have extension be updated when you release new versions, I have to use current public version, right?