Exemplo n.º 1
0
        public void ShowErrorTest()
        {
            var messageService = new MockMessageService();

            messageService.ShowError(message);
            Assert.AreEqual(MessageType.Error, messageService.MessageType);
            Assert.AreEqual(message, messageService.Message);
        }
Exemplo n.º 2
0
        public void ShowWarningTest()
        {
            var messageService = new MockMessageService();

            messageService.ShowWarning(message);
            Assert.AreEqual(MessageType.Warning, messageService.MessageType);
            Assert.AreEqual(message, messageService.Message);
        }
Exemplo n.º 3
0
        public void ShowMessageTest()
        {
            var messageService = new MockMessageService();

            messageService.ShowMessage(message);
            Assert.AreEqual(MessageType.Message, messageService.MessageType);
            Assert.AreEqual(message, messageService.Message);
        }
Exemplo n.º 4
0
        public void ShowQuestionTest_ReturnNull()
        {
            var messageService = new MockMessageService();

            var showQuestionCalled = false;
            messageService.ShowQuestionAction = m =>
            {
                showQuestionCalled = true;
                Assert.AreEqual(message, m);
                return null;
            };
            Assert.IsFalse(messageService.ShowQuestion(message).HasValue);
            Assert.IsTrue(showQuestionCalled);
        }
Exemplo n.º 5
0
        public void ShowQuestionTest_ReturnNull()
        {
            var messageService = new MockMessageService();

            var showQuestionCalled = false;

            messageService.ShowQuestionAction = m =>
            {
                showQuestionCalled = true;
                Assert.AreEqual(message, m);
                return(null);
            };
            Assert.IsFalse(messageService.ShowQuestion(message).HasValue);
            Assert.IsTrue(showQuestionCalled);
        }
Exemplo n.º 6
0
        public void ShowYesNoQuestionTest_ReturnTrue()
        {
            var messageService = new MockMessageService();

            var showQuestionCalled = false;

            messageService.ShowYesNoQuestionAction = m =>
            {
                showQuestionCalled = true;
                Assert.AreEqual(message, m);
                return(true);
            };
            Assert.IsTrue(messageService.ShowYesNoQuestion(message));
            Assert.IsTrue(showQuestionCalled);
        }
Exemplo n.º 7
0
        public void ShowYesNoQuestionTest_ReturnTrue()
        {
            var messageService = new MockMessageService();

            var showQuestionCalled = false;
            messageService.ShowYesNoQuestionAction = m =>
            {
                showQuestionCalled = true;
                Assert.AreEqual(message, m);
                return true;
            };
            Assert.IsTrue(messageService.ShowYesNoQuestion(message));
            Assert.IsTrue(showQuestionCalled);
        }