MSTest.TestAdapter/TestFramework 2.1.0 broke existing F# tests with a period in their name.
See original GitHub issueF# 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:
- Created 4 years ago
- Comments:7 (6 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
I’m willing to take a look at this tonight and will report back
@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.