Ejemplo n.º 1
0
        public void DeleteReturnsOk()
        {
            StylistController controller   = new StylistController();
            ActionResult      actionResult = controller.Delete(1);

            Assert.IsInstanceOfType(actionResult, typeof(RedirectToActionResult));
        }
        public void Show_HasCorrectModelType_Dictionary()
        {
            ViewResult view   = new StylistController().Show(1) as ViewResult;
            var        result = view.ViewData.Model;

            Assert.IsInstanceOfType(result, typeof(Dictionary <string, object>));
        }
        public void DeleteAll_ReturnsCorrectType_ActionResult()
        {
            StylistController controller = new StylistController();
            IActionResult     view       = controller.DeleteAll();

            Assert.IsInstanceOfType(view, typeof(RedirectToActionResult));
        }
        public void CreateForStylist_ReturnsCorrectType_True()
        {
            StylistController controller = new StylistController();
            IActionResult     view       = controller.Create("Olya");

            Assert.IsInstanceOfType(view, typeof(ViewResult));
        }
        public void Edit_ReturnsCorrectType_ActionResult()
        {
            StylistController controller = new StylistController();
            IActionResult     view       = controller.Edit(1);

            Assert.IsInstanceOfType(view, typeof(ViewResult));
        }
Ejemplo n.º 6
0
        public void CreateStylist_HasCorrectModelType_Dictionary()
        {
            ViewResult view   = new StylistController().Create("Name") as ViewResult;
            var        result = view.ViewData.Model;

            Assert.IsInstanceOfType(result, typeof(List <Stylist>));
        }
Ejemplo n.º 7
0
        public void UpdateReturnsOk()
        {
            StylistController controller = new StylistController();
            ActionResult      indexView  = controller.Edit(1);

            Assert.IsInstanceOfType(indexView, typeof(ViewResult));
        }
Ejemplo n.º 8
0
        public void Create_ReturnsCorrectActionType_RedirectToActionResult()
        {
            StylistController controller = new StylistController();
            IActionResult     view       = controller.Create("mike", "beard");

            Assert.IsInstanceOfType(view, typeof(RedirectToActionResult));
        }
Ejemplo n.º 9
0
        public void CreateClient_ReturnsCorrectType_ActionResult()
        {
            StylistController controller = new StylistController();
            IActionResult     view       = controller.Create(1, "Name");

            Assert.IsInstanceOfType(view, typeof(ViewResult));
        }
Ejemplo n.º 10
0
        public void Index_ReturnsCorrectView_True()
        {
            StylistController controller = new StylistController();
            ActionResult      indexView  = controller.Index() as ActionResult;

            Assert.IsInstanceOfType(indexView, typeof(ViewResult));
        }
Ejemplo n.º 11
0
        public void CreateClient_HasCorrectModelType_Dictionary()
        {
            ViewResult view   = new StylistController().Create(1, "Name") as ViewResult;
            var        result = view.ViewData.Model;

            Assert.IsInstanceOfType(result, typeof(Dictionary <string, object>));
        }
        public void StylistCreateForm_ReturnsCorrectView_True()
        {
            StylistController controller = new StylistController();
            ActionResult      indexView  = controller.CreateForm();

            Assert.IsInstanceOfType(indexView, typeof(ViewResult));
        }
Ejemplo n.º 13
0
        public void New_ReturnsCorrectType_True()
        {
            StylistController controller = new StylistController();
            IActionResult     view       = controller.New();

            Assert.IsInstanceOfType(view, typeof(ViewResult));
        }
Ejemplo n.º 14
0
        public void ViewAllStylists_ReturnsCorrectView_True()
        {
            StylistController controller = new StylistController();
            IActionResult     indexView  = controller.ViewAllStylists();

            Assert.IsInstanceOfType(indexView, typeof(ViewResult));
        }
Ejemplo n.º 15
0
        public void Create_RedirectsToCorrectAction_Index()
        {
            StylistController      controller   = new StylistController();
            RedirectToActionResult actionResult = controller.Create("mike", "beard") as RedirectToActionResult;
            string result = actionResult.ActionName;

            Assert.AreEqual(result, "Show");
        }
Ejemplo n.º 16
0
        public void Index_HasCorrectModelType_StylistList()
        {
            StylistController controller = new StylistController();
            ViewResult        indexView  = controller.Index() as ViewResult;
            var result = indexView.ViewData.Model;

            Assert.IsInstanceOfType(result, typeof(List <Stylist>));
        }
Ejemplo n.º 17
0
        public void Show_ReturnsCorrectView_True()
        {
            StylistController controller = new StylistController();
            int           id             = Stylist.CreateStylist("mike", "beard");
            IActionResult showView       = controller.Show(id);

            Assert.IsInstanceOfType(showView, typeof(ViewResult));
        }
Ejemplo n.º 18
0
        public void Show_HasCorrectModelType_Stylist()
        {
            StylistController controller = new StylistController();
            ViewResult        showView   = controller.Show(Stylist.CreateStylist("mike", "beard")) as ViewResult;
            var result = showView.ViewData.Model;

            Assert.IsInstanceOfType(result, typeof(Stylist));
        }
        public void New_ReturnCorrectView_True()
        {
            //Arrange
            StylistController controller = new StylistController();

            //Act
            ActionResult newView = controller.New();

            Assert.IsInstanceOfType(newView, typeof(ViewResult));
        }
        public void FindForm_ReturnsCorrectView_True()
        {
            //Arrange
            StylistController controller = new StylistController();

            //Act
            ActionResult indexView = controller.Find();

            //Assert
            Assert.IsInstanceOfType(indexView, typeof(ViewResult));
        }
        public void Blah_ReturnsExpectedView_True()
        {
            //Arrange
            StylistController controller = new StylistController();

            //Act
            ActionResult detailsView = controller.Details(0);

            //Assert
            Assert.IsInstanceOfType(detailsView, typeof(ViewResult));
        }
        public void CreateForm_ReturnsExpectedView_True()
        {
            //Arrange
            StylistController controller = new StylistController();

            //Act
            ActionResult createFormView = controller.CreateForm();

            //Assert
            Assert.IsInstanceOfType(createFormView, typeof(ViewResult));
        }
        public void Index_ReturnsView_True()
        {
            //Arrange
            StylistController controller = new StylistController();

            //Act
            ActionResult indexView = controller.Index();

            //Assert
            Assert.IsInstanceOfType(indexView, typeof(ViewResult));
        }
        public void StylistList_ReturnsCorrectView_True()
        {
            //Arrange
            StylistController controller = new StylistController();

            //Act
            ActionResult StylistListView = controller.StylistList();

            //Assert
            Assert.IsInstanceOfType(StylistListView, typeof(ViewResult));
        }
Ejemplo n.º 25
0
        public void UpdateForm_ReturnsCorrectView_True()
        {
            //Arrange
            StylistController controller = new StylistController();

            //Act
            ActionResult updateFormView = controller.UpdateForm(0);

            //Assert
            Assert.IsInstanceOfType(updateFormView, typeof(ViewResult));
        }
Ejemplo n.º 26
0
        public void Details_BringsYouToCorrectView()
        {
            //Arrange
            StylistController controller = new StylistController();

            //Act
            ActionResult detailsView = controller.Details(0);

            //Assert
            Assert.IsInstanceOfType(detailsView, typeof(ViewResult));
        }
Ejemplo n.º 27
0
        public void CreateForm_BringsYouToCorrectView()
        {
            //Arrange
            StylistController controller = new StylistController();

            //Act
            ActionResult createFormView = controller.CreateForm();

            //Assert
            Assert.IsInstanceOfType(createFormView, typeof(ViewResult));
        }
Ejemplo n.º 28
0
        public void Index_HasCorrectModelType_ItemList()
        {
            //Arrange
            ViewResult indexView = new StylistController().Index() as ViewResult;

            //Act
            var result = indexView.ViewData.Model;

            //Assert
            Assert.IsInstanceOfType(result, typeof(List <Stylist>));
        }
        public void StylistList_HasCorrectModelType_StylistList()
        {
            //Arrange
            ViewResult StylistListView = new StylistController().StylistList() as ViewResult;

            //Act
            var result = StylistListView.ViewData.Model;

            //Assert
            Assert.IsInstanceOfType(result, typeof(List <Stylist>));
        }
Ejemplo n.º 30
0
        public void FormReturnsCorrectView()
        {
            //Arrange\
            StylistController controller = new StylistController();

            //Act
            ActionResult formView = controller.Form();

            //Assert
            Assert.IsInstanceOfType(formView, typeof(ViewResult));
        }