Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public void ShowWarningTest_ServiceNull()
 {
     MessageServiceExtensions.ShowWarning(null, message);
 }