Skip to content

Commit b295496

Browse files
tests: log imgs file paths
1 parent 9611e7d commit b295496

1 file changed

Lines changed: 19 additions & 13 deletions

File tree

TestClient/ConversationsTests.cs

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,27 @@ public async Task Should_run_WebSocket_full_conversation_successfully(double htt
9797
Assert.AreEqual(WebSocketMessageType.Text, msgs[14].Type);
9898
Assert.AreEqual("I will close this connection in around 3s.", msgs[14].ReadAsUtf8Text());
9999

100-
bool sentImgEquality = await CheckIfFilesContentsAreEqualAsync(
101-
ClientServerFullConversation.GetClientExampleFilePath("small_file.jpg"),
102-
ClientServerFullConversation.GetServerExampleFilePath("received_img.jpg"));
103-
100+
string smallImgFilePath = ClientServerFullConversation.GetClientExampleFilePath("small_file.jpg");
101+
string largeImgFilePath = ClientServerFullConversation.GetServerExampleFilePath("large_file.jpg");
102+
string sentImgFilePath = ClientServerFullConversation.GetServerExampleFilePath("received_img.jpg");
103+
string receivedImgFilePath = ClientServerFullConversation.GetClientExampleFilePath("received_img.jpg");
104+
105+
Console.WriteLine("Small img file path: " + smallImgFilePath);
106+
Console.WriteLine("Sent img file path: " + sentImgFilePath);
107+
Console.WriteLine("Large img file path: " + largeImgFilePath);
108+
Console.WriteLine("Received img file path: " + receivedImgFilePath);
109+
110+
bool sentImgEquality = await CheckIfFilesContentsAreEqualAsync(smallImgFilePath, sentImgFilePath);
111+
112+
Assert.AreEqual(9784, new FileInfo(smallImgFilePath).Length);
113+
Assert.AreEqual(9784, new FileInfo(sentImgFilePath).Length);
104114
Assert.IsTrue(sentImgEquality);
105-
Assert.AreEqual(9784, new FileInfo(ClientServerFullConversation.GetClientExampleFilePath("small_file.jpg")).Length);
106-
Assert.AreEqual(9784, new FileInfo(ClientServerFullConversation.GetServerExampleFilePath("received_img.jpg")).Length);
107-
108-
bool receivedImgEquality = await CheckIfFilesContentsAreEqualAsync(
109-
ClientServerFullConversation.GetClientExampleFilePath("received_img.jpg"),
110-
ClientServerFullConversation.GetServerExampleFilePath("large_file.jpg"));
111115

116+
bool receivedImgEquality = await CheckIfFilesContentsAreEqualAsync(largeImgFilePath, receivedImgFilePath);
117+
118+
Assert.AreEqual(191316, new FileInfo(largeImgFilePath).Length);
119+
Assert.AreEqual(191316, new FileInfo(receivedImgFilePath).Length);
112120
Assert.IsTrue(receivedImgEquality);
113-
Assert.AreEqual(191316, new FileInfo(ClientServerFullConversation.GetClientExampleFilePath("received_img.jpg")).Length);
114-
Assert.AreEqual(191316, new FileInfo(ClientServerFullConversation.GetServerExampleFilePath("large_file.jpg")).Length);
115121
}
116122

117123
[TestMethod]
@@ -321,4 +327,4 @@ static HttpClient MakeHttpClient(bool disableSslVerification)
321327
}
322328

323329
#endregion
324-
}
330+
}

0 commit comments

Comments
 (0)