I have installed JetBrains' DotCover and ReSharper installed in Visual Studio 2019.
Unfortunatelly the DotCover code coverage seems to be not working. I have this sample class: using System;
namespace ClassLibrary1
{
public class Class1
{
public int X { get; set; }
public int Y { get; set; }
public int Division()
{
return X / Y;
}
}
}
And this sample unit test:
using ClassLibrary1;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTestProject1
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
var c = new Class1 {X = 10, Y = 2};
var d = c.Division();
Assert.AreEqual(d, 5);
}
}
}
Then in ReSharper's "Unit Test Sessions" window, I select "Cover Unit Tests" as shown below:
This action runs my tests and when I move to ReSharper's "Unit Test Coverage" window, I see all coverage percentages as 0% and a warning message stating "Coverage info for some tests is absent or outdated", as shown below:
Also, in the Visual Studio code editor window, all the statements in my class are marked as "Statement uncovered" as shown below:
So, for some reason dotCover seems to be not working. I tried dropping the coverage data and running the tests again, but the result is the same.
What am I missing?