Skip to content

Commit

Permalink
Add unit test for ProcessInfo.
Browse files Browse the repository at this point in the history
  • Loading branch information
haipz committed Nov 8, 2024
1 parent c3f6631 commit f7a9d62
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.Extensions.Diagnostics.ResourceMonitoring.Windows.Interop;
using Microsoft.TestUtilities;
using Xunit;

namespace Microsoft.Extensions.Diagnostics.ResourceMonitoring.Windows.Test;

/// <summary>
/// Process Info Interop Tests.
/// </summary>
/// <remarks>These tests are added for coverage reasons, but the code doesn't have
/// the necessary environment predictability to really test it.</remarks>
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX, SkipReason = "Windows specific.")]
public sealed class ProcessInfoTests
{
[ConditionalFact]
public void GetCurrentProcessMemoryUsage()
{
var workingSet64 = new ProcessInfo().GetCurrentProcessMemoryUsage();
Assert.True(workingSet64 > 0);
}
}

0 comments on commit f7a9d62

Please sign in to comment.