Skip to content

Commit

Permalink
Apply PR feedback - correct test
Browse files Browse the repository at this point in the history
  • Loading branch information
maryamariyan committed Jun 20, 2022
1 parent a3d550a commit 60f5f3b
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static void FullMode_SetInvalid_Throws()
}

[OuterLoop]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(true)]
[InlineData(false)]
public void CheckForNotificationWhenQueueIsFull(bool okToDrop)
Expand All @@ -73,7 +73,8 @@ public void CheckForNotificationWhenQueueIsFull(bool okToDrop)
var console = new TestConsole(sink);
var errorConsole = new TimesWriteCalledConsole();
string queueName = nameof(CheckForNotificationWhenQueueIsFull) + (okToDrop ? "InDropWriteMode" : "InWaitMode");
var processor = new ConsoleLoggerProcessor(console, errorConsole, ConsoleLoggerBufferFullMode.Wait, 1024);
var fullMode = okToDrop ? ConsoleLoggerBufferFullMode.DropWrite : ConsoleLoggerBufferFullMode.Wait;
var processor = new ConsoleLoggerProcessor(console, errorConsole, fullMode, maxQueueLength: 1);
var formatter = new SimpleConsoleFormatter(new TestFormatterOptionsMonitor<SimpleConsoleFormatterOptions>(
new SimpleConsoleFormatterOptions()));

Expand All @@ -84,8 +85,6 @@ public void CheckForNotificationWhenQueueIsFull(bool okToDrop)
object[] messageParams = Enumerable.Range(1, 100).Select(x => (object)x).ToArray();

// Act
processor.MaxQueueLength = 1;
processor.FullMode = okToDrop ? ConsoleLoggerBufferFullMode.DropWrite : ConsoleLoggerBufferFullMode.Wait;
for (int i = 0; i < 20000; i++)
{
logger.LogInformation(messageTemplate, messageParams);
Expand Down

0 comments on commit 60f5f3b

Please sign in to comment.