public void ThenTableBodyShouldBeReturnedWithTheCorrectlyBuiltIndexView()
        {
            Assert.AreEqual("{ table = , pager =  }", _result.Data.ToString());

            MockViewBuilder.Verify(b => b.BuildIndexView <TestEntity>(null,
                                                                      null,
                                                                      "key",
                                                                      "asc",
                                                                      It.IsAny <IEnumerable <string> >(),
                                                                      It.IsAny <IEnumerable <string> >(),
                                                                      It.IsAny <string>(),
                                                                      null), Times.Once());
        }
Beispiel #2
0
        public void ThenAViewResultShouldBeReturnedWithTheUpdateViewModel()
        {
            foreach (var actionResult in Results)
            {
                var result = actionResult as ViewResult;
                Assert.IsInstanceOfType(result.Model, typeof(UpdateView));
            }

            MockViewBuilder.Verify(b => b.BuildUpdateView <TestEntity>(Entity), Times.Exactly(3));

            MockRepository.Verify(r => r.Create(It.IsAny <TestEntity>()), Times.Never());
            MockRepository.Verify(r => r.Update(It.IsAny <TestEntity>(), It.IsAny <string[]>()), Times.Never());
            MockRepository.Verify(r => r.SaveChanges(), Times.Never());
        }
Beispiel #3
0
 public void ThenAViewResultShouldBeReturnedWithTheDetailsViewModel()
 {
     Assert.IsInstanceOfType(_result.Model, typeof(DetailsView));
     MockViewBuilder.Verify(b => b.BuildDetailsView <TestEntity>(_model, It.IsAny <IDetailsViewVisitor[]>()), Times.Once());
 }