question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MSTest.TestAdapter/TestFramework 2.1.0 broke existing F# tests with a period in their name.

See original GitHub issue

F# methods/functions are allowed to have special characters in their names by book-ending the name with two back-ticks. (Used for making friendly test names, etc.)

namespace NS
open Microsoft.VisualStudio.TestTools.UnitTesting
[<TestClass>]
type TC () =
    [<TestMethod>]
    member __.``a.b`` () : unit =
        ()

It seems that prior to 2.1.0, only the test explorer was messed up, showing a ‘group’ called a containing a test b, but with 2.1.0 it’s now broken them: the bogus b test fails: Method NS.TC.b does not exist. (although the Test Detail Summary still shows the correct name of a.b)

#466 appears to have introduced a change that works by splitting on periods within testCase.FullyQualifiedName; perhaps that was the cause, though based on the existing test explorer behavior, perhaps it was something else?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
slang25commented, Feb 8, 2020

I’m willing to take a look at this tonight and will report back

1reaction
nohwndcommented, Feb 13, 2020

@slang25 yeah I was working on this before, the problem there is that the original data are not available at that point and that why the original PR had the solution that we have now that is splitting the path on . which was reverted for a bit, and then causing the PR build to fail, because no test were matched, because the matching part had the full path to the test and not just the method name. But since in F# the method name is more flexible we are seeing this issue. So yes you are right. Hopefully this is not across public api that would need to change. If you need help with the PR feel free the push to your PR branch, it’s a draft anyway, and then we can collab on the fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running unit tests with .NET Core MSTest: "The following ...
I am running the test by right-clicking in the test method and selecting "Run Tests". The test ran fine the very first time...
Read more >
Unit testing C# with MSTest and .NET
Learn unit test concepts in C# and .NET through an interactive experience building a sample solution step-by-step using dotnet test and ...
Read more >
Unit Testing Overview
Provides an easy way to make sure new code changes did not break existing code. Changes to the code are easier to make...
Read more >
Migrating from MSTest to xUnit.net
Tests can then be migrated gradually without breaking the compiler nor the test results in most cases. Note: The version numbers in this...
Read more >
Intro to Unit Testing in C# using XUnit - YouTube
Unit testing is an important part of writing quality software. It is also a controversial and somewhat difficult topic to get started in....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found