Skip to content
18 changes: 17 additions & 1 deletion src/Common/Commands.Common.Test/PowerBILoggerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -105,4 +121,4 @@ public override void ExecuteCmdlet()
// Nothing
}
}
}
}
Loading