Skip to content

Commit f7a9d62

Browse files
committed
Add unit test for ProcessInfo.
1 parent c3f6631 commit f7a9d62

File tree

1 file changed

+24
-0
lines changed
  • test/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests/Windows

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using Microsoft.Extensions.Diagnostics.ResourceMonitoring.Windows.Interop;
5+
using Microsoft.TestUtilities;
6+
using Xunit;
7+
8+
namespace Microsoft.Extensions.Diagnostics.ResourceMonitoring.Windows.Test;
9+
10+
/// <summary>
11+
/// Process Info Interop Tests.
12+
/// </summary>
13+
/// <remarks>These tests are added for coverage reasons, but the code doesn't have
14+
/// the necessary environment predictability to really test it.</remarks>
15+
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX, SkipReason = "Windows specific.")]
16+
public sealed class ProcessInfoTests
17+
{
18+
[ConditionalFact]
19+
public void GetCurrentProcessMemoryUsage()
20+
{
21+
var workingSet64 = new ProcessInfo().GetCurrentProcessMemoryUsage();
22+
Assert.True(workingSet64 > 0);
23+
}
24+
}

0 commit comments

Comments
 (0)