public void AddStylist_ReturnsCorrectActionType_RedirectToActionResult()
        {
            SpecialtiesController controller = new SpecialtiesController();
            IActionResult         view       = controller.AddStylist(1, 1);

            Assert.IsInstanceOfType(view, typeof(RedirectToActionResult));
        }
Beispiel #2
0
        public void All_ReturnsCorrectView_True()
        {
            SpecialtiesController controller = new SpecialtiesController();
            ActionResult          indexView  = controller.Add();

            Assert.IsInstanceOfType(indexView, typeof(ViewResult));
        }
        public void Show_ReturnsCorrectView_True()
        {
            SpecialtiesController controller = new SpecialtiesController();
            ActionResult          showView   = controller.Show(1);

            Assert.IsInstanceOfType(showView, typeof(ViewResult));
        }
        public void Create_ReturnsCorrectActionType_RedirectToActionResult()
        {
            SpecialtiesController controller = new SpecialtiesController();
            IActionResult         view       = controller.Create("Mullet");

            Assert.IsInstanceOfType(view, typeof(RedirectToActionResult));
        }
Beispiel #5
0
        public void Details_ReturnsCorrectView_True()
        {
            SpecialtiesController controller   = new SpecialtiesController();
            IActionResult         actionResult = controller.Details(1);
            ViewResult            result       = controller.Details(1) as ViewResult;

            Assert.IsInstanceOfType(result, typeof(ViewResult));
        }
        public void Create_RedirectsToCorrectAction_Index()
        {
            SpecialtiesController  controller   = new SpecialtiesController();
            RedirectToActionResult actionResult = controller.Create("ducktail") as RedirectToActionResult;
            string result = actionResult.ActionName;

            Assert.AreEqual(result, "Index");
        }
        public void AddStylist_RedirectsToCorrectAction_Show()
        {
            SpecialtiesController  controller   = new SpecialtiesController();
            RedirectToActionResult actionResult = controller.AddStylist(1, 1) as RedirectToActionResult;
            string result = actionResult.ActionName;

            Assert.AreEqual(result, "Show");
        }
        public void Show_HasCorrectModelType_Dictionary()
        {
            SpecialtiesController controller = new SpecialtiesController();
            ViewResult            showView   = controller.Show(1) as ViewResult;
            var result = showView.ViewData.Model;

            Assert.IsInstanceOfType(result, typeof(Dictionary <string, object>));
        }
        public void Index_HasCorrectModelType_SpecialtyList()
        {
            SpecialtiesController controller = new SpecialtiesController();
            ViewResult            indexView  = controller.Index() as ViewResult;
            var result = indexView.ViewData.Model;

            Assert.IsInstanceOfType(result, typeof(List <Specialty>));
        }
        public void Index_ReturnsCorrectView_True()
        {
            //Arrange
            //Act
            ActionResult result = new SpecialtiesController().Index();

            //Assert
            Assert.IsInstanceOfType(result, typeof(ViewResult));
        }
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            SpecialtiesForm specForm = new SpecialtiesForm();
            StorageContext  context  = new StorageContext();

            _ = new SpecialtiesController(specForm, context);
            Application.Run(specForm);
        }
        public void New_ReturnsCorrectView_True()
        {
            //Arrange
            SpecialtiesController controller = new SpecialtiesController();
            // Act
            ActionResult newView = controller.New();

            // Assert
            Assert.IsInstanceOfType(newView, typeof(ViewResult));
        }
Beispiel #13
0
        public void Details_ReturnsCorrectModelType_Specialty()
        {
            SpecialtiesController controller   = new SpecialtiesController();
            IActionResult         actionResult = controller.Details(1);
            ViewResult            indexView    = controller.Details(1) as ViewResult;

            var result = indexView.ViewData.Model;

            Assert.IsInstanceOfType(result, typeof(Specialty));
        }
Beispiel #14
0
        public void CreatePairs_ReturnsCorrectView_True()
        {
            //Arrange
            SpecialtiesController controller = new SpecialtiesController();

            //Act
            ActionResult pairView = controller.CreatePairs();

            //Assert
            Assert.IsInstanceOfType(pairView, typeof(ViewResult));
        }
        public void Index_ReturnsCorrectView_View()
        {
            //Arrange
            SpecialtiesController controller = new SpecialtiesController();

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

            //Assert
            Assert.IsInstanceOfType(indexView, typeof(ViewResult));
        }
Beispiel #16
0
        public void Details_HasCorrectModelType_True()
        {
            //arrange
            ViewResult detailsView = new SpecialtiesController().Details(1) as ViewResult;

            //act
            var result = detailsView.ViewData.Model;

            //assert
            Assert.IsInstanceOfType(result, typeof(Dictionary <string, object>));
        }
Beispiel #17
0
        public void Search_HasCorrectModelType_SpecialtyList()
        {
            //Arrange
            ViewResult indexView = new SpecialtiesController().Search("testSpecialty") as ViewResult;

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

            //Assert
            Assert.IsInstanceOfType(result, typeof(List <Specialty>));
        }
Beispiel #18
0
        public void Details_ReturnsCorrectView_True()
        {
            //Arrange
            SpecialtiesController controller = new SpecialtiesController();

            //Act
            ActionResult indexView = controller.Details(1);

            //Assert
            Assert.IsInstanceOfType(indexView, typeof(ViewResult));
        }
Beispiel #19
0
        public void Delete_ReturnsCorrectActionType_RedirectToActionResult()
        {
            //Arrange
            SpecialtiesController controller = new SpecialtiesController();

            //Act
            IActionResult view = controller.Delete(1);

            //Assert
            Assert.IsInstanceOfType(view, typeof(RedirectToActionResult));
        }
Beispiel #20
0
        public void Detail_HasCorrectModelType_SpecialtyList()
        {
            //Arrange
            ViewResult indexView = new SpecialtiesController().Detail(1) as ViewResult;

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

            //Assert
            Assert.IsInstanceOfType(result, typeof(Specialty));
        }
Beispiel #21
0
        public void Edit_ReturnsCorrectActionType_RedirectToActionResult()
        {
            //Arrange
            SpecialtiesController controller = new SpecialtiesController();

            //Act
            IActionResult view = controller.EditPost(1, "Colorist");

            //Assert
            Assert.IsInstanceOfType(view, typeof(RedirectToActionResult));
        }
Beispiel #22
0
        public void Create_ReturnsCorrectActionType_ViewResult()
        {
            //Arrange
            SpecialtiesController controller = new SpecialtiesController();

            //Act
            IActionResult view = controller.Create("Colorist");

            //Assert
            Assert.IsInstanceOfType(view, typeof(ViewResult));
        }
        public void Edit_HasCorrectModelType_StylistList()
        {
            //Arrange
            ViewResult editView = new SpecialtiesController().Edit(2) as ViewResult;

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

            //Assert
            Assert.IsInstanceOfType(result, typeof(Specialty));
        }
        public void Show_HasCorrectModelType_StylistList()
        {
            //Arrange
            ViewResult showView = new SpecialtiesController().Show(1) as ViewResult;

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

            //Assert
            Assert.IsInstanceOfType(result, typeof(Dictionary <string, object>));
        }
        public void Index_HasCorrectModelType_StylistList()
        {
            //Arrange
            ViewResult indexView = new SpecialtiesController().Index() as ViewResult;

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

            //Assert
            Assert.IsInstanceOfType(result, typeof(List <Specialty>));
        }
Beispiel #26
0
        public void Index_HasCorrectModelType_Results()
        {
            //Arrange
            SpecialtiesController controller   = new SpecialtiesController();
            ViewResult            costDataType = controller.Index() as ViewResult;

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

            //Assert
            Assert.IsInstanceOfType(result, typeof(List <Specialty>));
        }
Beispiel #27
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var context = new StorageContext();

            var specWindow     = new SpecialtiesForm();
            var specController = new SpecialtiesController(context, specWindow);

            Application.Run(specWindow);
        }
Beispiel #28
0
        public void Details_ReturnIfView_True()
        {
            //arrange
            SpecialtiesController controller = new SpecialtiesController();

            //act
            IActionResult detailsView = controller.Index();
            ViewResult    result      = detailsView as ViewResult;

            //assert
            Assert.IsInstanceOfType(result, typeof(ViewResult));
        }
Beispiel #29
0
 public SpecialtiesControllerTests()
 {
     controller = new SpecialtiesController(getter.Object);
 }