Exemple #1
0
        public void PostEmployer_Failure_CreateEmployerFailed()
        {
            var service = new Mock <IEmployerService>();

            service.Setup(S => S.CreateEmployer(It.IsAny <EmployerCreate>())).Returns(false);
            var controller = new EmployerController(service.Object);

            var model = new EmployerCreate();

            var result = controller.Post(model);

            Assert.IsInstanceOfType(result, typeof(InternalServerErrorResult));
        }
Exemple #2
0
        public void PostEmployer_Success()
        {
            var service = new Mock <IEmployerService>();

            service.Setup(S => S.CreateEmployer(It.IsAny <EmployerCreate>())).Returns(true);
            var controller = new EmployerController(service.Object);

            var model = new EmployerCreate();

            var result = controller.Post(model);

            Assert.IsInstanceOfType(result, typeof(OkResult));
        }