コード例 #1
0
        public void ListByTaxon_ReturnsConfiguredView()
        {
            var model = new DummyImageGalleryModel();

            using (var controller = new DummyImageGalleryController(model))
            {
                controller.ListTemplateName = "MyTestTemplate";

                var result = (ViewResult)controller.ListByTaxon(null, null);

                Assert.AreEqual("List.MyTestTemplate", result.ViewName);
            }
        }
コード例 #2
0
        public void Details_ReturnsConfiguredView()
        {
            var model = new DummyImageGalleryModel();

            using (var controller = new DummyImageGalleryController(model))
            {
                controller.DetailTemplateName = "MyTestTemplate";

                var result = (ViewResult)controller.Details(null);

                Assert.AreEqual("Detail.MyTestTemplate", result.ViewName);
            }
        }
コード例 #3
0
        public void GetLocations_ReturnsModelLocations()
        {
            var expectedLocations = new List <IContentLocationInfo>();
            var model             = new DummyImageGalleryModel();

            model.DummyLocations = expectedLocations;

            using (var controller = new DummyImageGalleryController(model))
            {
                var result = controller.GetLocations();

                Assert.AreSame(expectedLocations, result);
            }
        }
コード例 #4
0
        public void Index_ReturnsConfiguredView()
        {
            var model = new DummyImageGalleryModel();

            model.ItemsPerPage = 20;

            using (var controller = new DummyImageGalleryController(model))
            {
                controller.ListTemplateName = "MyTestTemplate";

                var result = (ViewResult)controller.Index(null);

                Assert.AreEqual("List.MyTestTemplate", result.ViewName);
            }
        }