Ejemplo n.º 1
0
        public void Index_Returns_All_Quotes_In_DB()
        {
            //Arrange
            var quote = Mock.Create <IQuote>();

            Mock.Arrange(() => quote.GetQuotes()).
            Returns(new List <QuoteListModel>()
            {
                new QuoteListModel {
                    Quote = "Hey", KidName = "Sophie", QuoteId = 1, CreatedUtc = DateTimeOffset.Parse("2005-09-01")
                },
                new QuoteListModel {
                    Quote = "Hey", KidName = "Sophie", QuoteId = 2, CreatedUtc = DateTimeOffset.Parse("2005-09-01")
                }
            }).MustBeCalled();
            Guid newGuid = new Guid();


            //Act
            QuoteController controller = new QuoteController(quote);
            ViewResult      viewResult = controller.Index();
            var             model      = viewResult.Model as IEnumerable <QuoteListModel>;

            //Assert
            Assert.AreEqual(quote, 2);
        }