Пример #1
0
        public IActionResult Index()
        {
            var message = _messageOfTheDayService.GetMessageOfTheDay();

            return(View(new MessageOfTheDayViewModel {
                ImageUri = message.ImageUri, Message = _localizer[message.Text]
            }));
        }
Пример #2
0
            public void WhenGetMessageOfDayThenExpectedMessageReturned()
            {
                var expected = new Message
                {
                    Text     = mockDayOfWeekMesssageText,
                    ImageUri = mockDayOfWeekMesssageImageURI,
                };

                var result = _sut.GetMessageOfTheDay();


                result.Should().BeEquivalentTo(expected);
            }
Пример #3
0
            public void WhenGetMessageOfDayResultsInException_ThenExceptionIsRaised()
            {
                Exception ex = Assert.Throws <Exception>(() => _sut.GetMessageOfTheDay());

                Assert.Equal(ex.Message, mockExceptionMessage);
            }