diff --git a/src/Common/Commands.Common.Test/PowerBILoggerTests.cs b/src/Common/Commands.Common.Test/PowerBILoggerTests.cs index 81338cb8..56d4034e 100644 --- a/src/Common/Commands.Common.Test/PowerBILoggerTests.cs +++ b/src/Common/Commands.Common.Test/PowerBILoggerTests.cs @@ -31,6 +31,22 @@ public void TestDetectingIsPowerBICmdlet() Assert.IsNull(logger.GetPowerBICmdlet); } + + [TestMethod] + public void TestWriteWarningAddsMessage() + { + var logger = new PowerBILoggerMock() + { + Cmdlet = new NonPowerBICmdlet() + }; + + string warning = "This is a warning!"; + logger.WriteWarning(warning); + + Assert.AreEqual(1, logger.WarningMessages.Count); + Assert.AreEqual(warning, logger.WarningMessages[0]); + } + [TestMethod] public void TestMainThreadDetection() { @@ -105,4 +121,4 @@ public override void ExecuteCmdlet() // Nothing } } -} \ No newline at end of file +}