I try to test my custom ReSharper Context Action using ReSharper SDK built-in test infrastucture. I've created an input file, an output file (.gold
) and run the test. Two problems occur:
- Test is always successful (even if input and
.gold
files are completely different, or empty etc.); - There is no
.tmp
file appears along with input and.gold
files.
However, if I rename input file, then the test run fails with "file does not exist" exception.
My test project's structure is the same as described in docs.
TestEnvironment.cs:
[assembly: RequiresSTA]
[ZoneDefinition]
public class TestEnvironmentZone : ITestsZone, IRequire<PsiFeatureTestZone>
{
}
[SetUpFixture]
public class ReSharperTestEnvironmentAssembly : ExtensionTestEnvironmentAssembly<TestEnvironmentZone>
{
}
Test class:
[TestFixture]
public class FooContextActionTests : ContextActionTestBase<FooContextAction>
{
protected override void ProcessAction(Func<FooContextAction> action, ITextControl control, ISolution solution)
{
}
protected override string ExtraPath { get; }
protected override string RelativeTestDataPath => @"FooContextActionTests";
[Test]
public void Test01()
{
DoTestFiles("Test01.cs");
}
}
I've made the similar test for simple quick-fix. That test works as expected and reacts to any change of input or .gold
file. So the question is how to test Context Action properly.
ReSharper SDK 9.2 is used.