Пример #1
0
        public void ShowErrorTest()
        {
            var messageService = new MockMessageService();

            messageService.ShowError(message);
            Assert.AreEqual(MessageType.Error, messageService.MessageType);
            Assert.AreEqual(message, messageService.Message);
        }
Пример #2
0
        public void ShowWarningTest()
        {
            var messageService = new MockMessageService();

            messageService.ShowWarning(message);
            Assert.AreEqual(MessageType.Warning, messageService.MessageType);
            Assert.AreEqual(message, messageService.Message);
        }
Пример #3
0
        public void ShowMessageTest()
        {
            var messageService = new MockMessageService();

            messageService.ShowMessage(message);
            Assert.AreEqual(MessageType.Message, messageService.MessageType);
            Assert.AreEqual(message, messageService.Message);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }