I am using dotMemory Unit with NUnit Framework. And get this below exception when i try to run my Test case in Visual Studio with "Run under dotMemory Unit".
DotMemoryUnitException : dotMemory Unit methods were called from outside a test method:
- If you work with a unit test runner that is not supported out of the box, then probably calls to dotMemory Unit were made from outside the DotMemoryUnitController TestStart() and TestEnd() methods or these methods were called in the wrong order. Learn more about the DotMemoryUnitController class: https://www.jetbrains.com/help/dotmemory-unit/3.0/Working_with_Unsupported_Unit_Testing_Frameworks.html
- If your unit test runner is supported out of the box, then probably your assembly does not use dotMemory Unit by itself but calls the code from other assemblies that do use dotMemory Unit. To fix the issue, apply the 'EnableDotMemoryUnitSupportAttribute' attribute to your assembly.
at JetBrains.dotMemoryUnit.dotMemory.Check(Action`1 check)
My test case is something like this
public async Task SomeTestCase()
//At end of test case
memory => Assert.That(memory.GetObjects(where => where.Type.Is<MyType>()), Is.EqualTo(0)));
As far as i understand Nunit is supported by dotMemory Unit.
I have also added [assembly: EnableDotMemoryUnitSupport] in my test case lib