Skip to content

Commit

Permalink
Merge pull request #23 from viordash/tests-stability
Browse files Browse the repository at this point in the history
improve comm tests stability
  • Loading branch information
viordash authored Sep 30, 2023
2 parents 76e58ae + 59c8c82 commit c711c68
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public async Task Send_CommonData_Test() {
clipboardData.Add("Text", new MemoryStream(System.Text.Encoding.Unicode.GetBytes("Text 0123456789")));

await client.SendData(clipboardData);
client.Stop();
await server.Stop();
client.Stop();

dispatchServiceMock.Verify(x => x.ReceiveData(It.IsAny<ClipboardData>()), Times.Exactly(2));
Assert.IsNotNull(receivedClipboard);
Expand Down Expand Up @@ -93,8 +93,8 @@ public async Task Send_Common_Big_Data_Test() {
clipboardData.Add("Text", new MemoryStream(bytes));

await client.SendData(clipboardData);
client.Stop();
await server.Stop();
client.Stop();

dispatchServiceMock.VerifyAll();
Assert.IsNotNull(receivedClipboard);
Expand Down Expand Up @@ -143,8 +143,8 @@ public async Task Send_Files_Test() {

} finally {
Directory.Delete(testsPath, true);
client.Stop();
await server.Stop();
client.Stop();
}

dispatchServiceMock.Verify(x => x.ReceiveFiles(It.IsAny<IList<string>>()), Times.Exactly(3));
Expand Down Expand Up @@ -199,8 +199,8 @@ public async Task Send_Big_File_Test() {
await client.SendFileDropList(files);
} finally {
Directory.Delete(testsPath, true);
client.Stop();
await server.Stop();
client.Stop();
}

dispatchServiceMock.VerifyAll();
Expand Down Expand Up @@ -271,8 +271,8 @@ public async Task Send_Files_And_Folders_Test() {
await client.SendFileDropList(files);
} finally {
Directory.Delete(testsPath, true);
client.Stop();
await server.Stop();
client.Stop();
}

dispatchServiceMock.VerifyAll();
Expand Down Expand Up @@ -355,8 +355,8 @@ public async Task Send_identical_Files__Test() {
await client.SendFileDropList(files);
} finally {
Directory.Delete(testsPath, true);
client.Stop();
await server.Stop();
client.Stop();
}

dispatchServiceMock.VerifyAll();
Expand Down Expand Up @@ -411,7 +411,6 @@ public async Task DataClient_Ping_Periodic_Test() {
});

server.Start();
await Task.Delay(1000);
client.Start();

await AwaitClientConnectStatus(true);
Expand All @@ -424,8 +423,8 @@ public async Task DataClient_Ping_Periodic_Test() {
connectStatusServiceMock.Verify(x => x.ClientOffline(), Times.Once());
connectStatusServiceMock.Verify(x => x.ClientOnline(), Times.AtLeast(3));

client.Stop();
await server.Stop();
client.Stop();
}
}
}

0 comments on commit c711c68

Please sign in to comment.