Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve comm tests stability #23

Merged
merged 1 commit into from
Sep 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
}
}
}