|
15 | 15 |
|
16 | 16 | using System;
|
17 | 17 | using System.Diagnostics;
|
| 18 | +using System.Globalization; |
18 | 19 | using System.IO;
|
19 | 20 | using System.Net;
|
20 | 21 | using FluentAssertions;
|
@@ -53,7 +54,7 @@ public void Handle_with_ClusterOpenedEvent_should_trace_event()
|
53 | 54 | const string logFileName = traceSourceName + "-log";
|
54 | 55 | var @event = new ClusterOpenedEvent(new ClusterId(), new ClusterSettings(), new TimeSpan(1));
|
55 | 56 | var expectedLogMessage =
|
56 |
| - $"{TraceSourceEventHelper.Label(@event.ClusterId)}: opened in {@event.Duration.TotalMilliseconds}ms."; |
| 57 | + $"{TraceSourceEventHelper.Label(@event.ClusterId)}: opened in {@event.Duration.TotalMilliseconds.ToString(CultureInfo.InvariantCulture)}ms."; |
57 | 58 | var traceSource = CreateTraceSource(logFileName, logFileName);
|
58 | 59 | var subject = new TraceSourceSdamEventSubscriber(traceSource);
|
59 | 60 |
|
@@ -86,7 +87,7 @@ public void Handle_with_ClusterClosedEvent_should_trace_event()
|
86 | 87 | const string logFileName = traceSourceName + "-log";
|
87 | 88 | var @event = new ClusterClosedEvent(new ClusterId(), new TimeSpan(1));
|
88 | 89 | var expectedLogMessage =
|
89 |
| - $"{TraceSourceEventHelper.Label(@event.ClusterId)}: closed in {@event.Duration.TotalMilliseconds}ms."; |
| 90 | + $"{TraceSourceEventHelper.Label(@event.ClusterId)}: closed in {@event.Duration.TotalMilliseconds.ToString(CultureInfo.InvariantCulture)}ms."; |
90 | 91 | var traceSource = CreateTraceSource(logFileName, logFileName);
|
91 | 92 | var subject = new TraceSourceSdamEventSubscriber(traceSource);
|
92 | 93 |
|
@@ -126,7 +127,7 @@ public void Handle_with_ClusterAddedServerEvent_should_trace_event()
|
126 | 127 | new TimeSpan(1));
|
127 | 128 | var expectedLogMessage =
|
128 | 129 | $"{TraceSourceEventHelper.Label(@event.ServerId.ClusterId)}: added server " +
|
129 |
| - $"{TraceSourceEventHelper.Format(@event.ServerId)} in {@event.Duration.TotalMilliseconds}ms."; |
| 130 | + $"{TraceSourceEventHelper.Format(@event.ServerId)} in {@event.Duration.TotalMilliseconds.ToString(CultureInfo.InvariantCulture)}ms."; |
130 | 131 | var traceSource = CreateTraceSource(logFileName, logFileName);
|
131 | 132 | var subject = new TraceSourceSdamEventSubscriber(traceSource);
|
132 | 133 |
|
@@ -167,7 +168,7 @@ public void Handle_with_ClusterRemovedServerEvent_should_trace_event()
|
167 | 168 | new TimeSpan(42));
|
168 | 169 | var expectedLogMessage =
|
169 | 170 | $"{TraceSourceEventHelper.Label(@event.ServerId.ClusterId)}: removed server " +
|
170 |
| - $"{TraceSourceEventHelper.Format(@event.ServerId)} in {@event.Duration.TotalMilliseconds}ms. " + |
| 171 | + $"{TraceSourceEventHelper.Format(@event.ServerId)} in {@event.Duration.TotalMilliseconds.ToString(CultureInfo.InvariantCulture)}ms. " + |
171 | 172 | $"Reason: {@event.Reason}";
|
172 | 173 | var traceSource = CreateTraceSource(logFileName, logFileName);
|
173 | 174 | var subject = new TraceSourceSdamEventSubscriber(traceSource);
|
@@ -251,7 +252,7 @@ public void Handle_with_ServerOpenedEvent_should_trace_event()
|
251 | 252 | new ServerSettings(),
|
252 | 253 | new TimeSpan(42));
|
253 | 254 | var expectedLogMessage =
|
254 |
| - $"{TraceSourceEventHelper.Label(@event.ServerId)}: opened in {@event.Duration.TotalMilliseconds}ms."; |
| 255 | + $"{TraceSourceEventHelper.Label(@event.ServerId)}: opened in {@event.Duration.TotalMilliseconds.ToString(CultureInfo.InvariantCulture)}ms."; |
255 | 256 | var traceSource = CreateTraceSource(logFileName, logFileName);
|
256 | 257 | var subject = new TraceSourceSdamEventSubscriber(traceSource);
|
257 | 258 |
|
@@ -287,7 +288,7 @@ public void Handle_with_ServerClosedEvent_should_trace_event()
|
287 | 288 | new ServerId(new ClusterId(), new IPEndPoint(IPAddress.Parse("1.2.3.4"), 42)),
|
288 | 289 | new TimeSpan(42));
|
289 | 290 | var expectedLogMessage =
|
290 |
| - $"{TraceSourceEventHelper.Label(@event.ServerId)}: closed in {@event.Duration.TotalMilliseconds}ms."; |
| 291 | + $"{TraceSourceEventHelper.Label(@event.ServerId)}: closed in {@event.Duration.TotalMilliseconds.ToString(CultureInfo.InvariantCulture)}ms."; |
291 | 292 | var traceSource = CreateTraceSource(logFileName, logFileName);
|
292 | 293 | var subject = new TraceSourceSdamEventSubscriber(traceSource);
|
293 | 294 |
|
@@ -325,7 +326,7 @@ public void Handle_with_ServerHeartbeatSucceededEvent_should_trace_event()
|
325 | 326 | new TimeSpan(42),
|
326 | 327 | awaited: true);
|
327 | 328 | var expectedLogMessage =
|
328 |
| - $"{TraceSourceEventHelper.Label(@event.ConnectionId)}: sent heartbeat in {@event.Duration.TotalMilliseconds}ms."; |
| 329 | + $"{TraceSourceEventHelper.Label(@event.ConnectionId)}: sent heartbeat in {@event.Duration.TotalMilliseconds.ToString(CultureInfo.InvariantCulture)}ms."; |
329 | 330 | var traceSource = CreateTraceSource(logFileName, logFileName);
|
330 | 331 | var subject = new TraceSourceSdamEventSubscriber(traceSource);
|
331 | 332 |
|
|
0 commit comments