public void CallbackTestLoggersPii(LogLevel level) { MsalLogger logger = CreateLogger(level, true); var counter = 0; var validationCounter = 1; var levelToValidate = LogLevel.Always; Action incrementCounter = () => { if (level > levelToValidate) { validationCounter++; } levelToValidate++; }; _callback.When(x => x(LogLevel.Always, Arg.Any <string>(), true)).Do(x => counter++); logger.AlwaysPii(TestConstants.TestMessage, string.Empty); Assert.AreEqual(validationCounter, counter); incrementCounter.Invoke(); _callback.When(x => x(LogLevel.Error, Arg.Any <string>(), true)).Do(x => counter++); logger.ErrorPii(new ArgumentException(TestConstants.TestMessage)); Assert.AreEqual(validationCounter, counter); incrementCounter.Invoke(); _callback.When(x => x(LogLevel.Warning, Arg.Any <string>(), true)).Do(x => counter++); logger.WarningPii(TestConstants.TestMessage, string.Empty); Assert.AreEqual(validationCounter, counter); incrementCounter.Invoke(); _callback.When(x => x(LogLevel.Info, Arg.Any <string>(), true)).Do(x => counter++); logger.InfoPii(TestConstants.TestMessage, string.Empty); Assert.AreEqual(validationCounter, counter); incrementCounter.Invoke(); _callback.When(x => x(LogLevel.Verbose, Arg.Any <string>(), true)).Do(x => counter++); logger.VerbosePii(TestConstants.TestMessage, string.Empty); Assert.AreEqual(validationCounter, counter); }