1 つのテスト クラスを持つ .Net 5 ターゲット フレームワークを使用して、新しい XUnit テスト プロジェクトを作成しました。
public class SomeTests
{
private readonly ITestOutputHelper output;
public SomeTests(ITestOutputHelper output)
{
this.output = output;
DotMemoryUnitTestOutput.SetOutputMethod(output.WriteLine);
}
[Fact]
[DotMemoryUnit(CollectAllocations = true)]
public void SomeTest()
{
var beforeTestMethodPoint = dotMemory.Check();
var allocatedArray = new string[10];
dotMemory.Check(afterTestMethodPoint => Assert.True(afterTestMethodPoint.GetTrafficFrom(beforeTestMethodPoint).AllocatedMemory.SizeInBytes == 0));
}
}
インストールされている NuGet パッケージは JetBrains.DotMemoryUnit 3.1.20200127.214830 です
テストを実行した後 (dotMemory Unit で実行)、次の出力が作成されます。
Xunit.Sdk.TrueException
Assert.True() Failure
Expected: True
Actual: False
at TestsDotMemory.SomeTests.<>c__DisplayClass2_0.<SomeTest>b__0(Memory afterTestMethodPoint) in SomeTests.cs:line 25
at JetBrains.dotMemoryUnit.dotMemory.Check(Action`1 check)
at TestsDotMemory.SomeTests.SomeTest() in SomeTests.cs:line 25
[dotMemory Unit]: The workspace is saved to "file:///C:/Users/username/AppData/Local/Temp/dotMemoryUnitWorkspace/Run-2021-03-06T10-15-06.288/SomeTest.2021-03-06T10-15-11.629.dmw". (File size: 9 MB)
.dmw ファイルのリンクをクリックすると、dotmemory アプリケーションが開きます
現在のアプリケーションのバージョンとライセンス情報
JetBrains dotMemory 2020.3.3 Build 203.0.20210217.101844 built on 2021-02-17
dotMemory 2020.3.20210217.101844
dotMemory 2020.3.3 free trial period is running. 2 days left.
ダイアログウィンドウが表示されます
The workspace you are trying to open is incompatible with the current dotMemory version. Do you want to open the workspace in a compatible portable dotMemory version?
はいを選択すると、dotMemory 2019.1.3 が開き、ライセンス情報に関するダイアログが表示されます (私のライセンスは 2020.3 のみです)
では、dotMemory 2020.3.3 が .dmw ファイルをサポートしていないのはなぜですか?