Skip to content

Commit

Permalink
chore: use task.delay
Browse files Browse the repository at this point in the history
  • Loading branch information
rvazarkar committed Aug 15, 2024
1 parent 56557f8 commit 65499f0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions test/unit/ComputerSessionProcessorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,8 @@ public async Task ComputerSessionProcessor_ReadUserSessionsPrivileged_FilteringW
public async Task ComputerSessionProcessor_TestTimeout() {
var nativeMethods = new Mock<NativeMethods>();
nativeMethods.Setup(x => x.NetSessionEnum(It.IsAny<string>())).Callback(() => {
Thread.Sleep(200);
Task.Delay(1000).Wait();
}).Returns(Array.Empty<NetSessionEnumResults>());
nativeMethods.Setup(x => x.NetWkstaUserEnum(It.IsAny<string>())).Callback(() => {
Thread.Sleep(200);
}).Returns(Array.Empty<NetWkstaUserEnumResults>());
var processor = new ComputerSessionProcessor(new MockLdapUtils(),"", nativeMethods.Object);
var receivedStatus = new List<CSVComputerStatus>();
var machineDomainSid = $"{Consts.MockDomainSid}-1000";
Expand All @@ -258,7 +255,7 @@ public async Task ComputerSessionProcessor_TestTimeout() {
public async Task ComputerSessionProcessor_TestTimeoutPrivileged() {
var nativeMethods = new Mock<NativeMethods>();
nativeMethods.Setup(x => x.NetWkstaUserEnum(It.IsAny<string>())).Callback(() => {
Thread.Sleep(200);
Task.Delay(1000).Wait();
}).Returns(Array.Empty<NetWkstaUserEnumResults>());
var processor = new ComputerSessionProcessor(new MockLdapUtils(),"", nativeMethods.Object);
var receivedStatus = new List<CSVComputerStatus>();
Expand Down

0 comments on commit 65499f0

Please sign in to comment.