public void ShowMessageTest() { MockMessageService messageService = new MockMessageService(); string message = "Hello World"; AssertHelper.ExpectedException <ArgumentNullException>(() => MessageServiceExtensions.ShowMessage(null, message)); AssertHelper.ExpectedException <ArgumentNullException>(() => MessageServiceExtensions.ShowWarning(null, message)); AssertHelper.ExpectedException <ArgumentNullException>(() => MessageServiceExtensions.ShowError(null, message)); messageService.ShowMessage(message); Assert.AreEqual(MessageType.Message, messageService.MessageType); Assert.AreEqual(message, messageService.Message); messageService.Clear(); messageService.ShowWarning(message); Assert.AreEqual(MessageType.Warning, messageService.MessageType); Assert.AreEqual(message, messageService.Message); messageService.Clear(); messageService.ShowError(message); Assert.AreEqual(MessageType.Error, messageService.MessageType); Assert.AreEqual(message, messageService.Message); }
public void ShowWarningTest_ServiceNull() { MessageServiceExtensions.ShowWarning(null, message); }