コード例 #1
0
        public void ShouldCheckTypeOfInstanceResultAfterDeleteConfirmedFromPatientsController_WithMock()
        {
            var patient = new Patient();
            var service = new Mock <IPatientRepository>();

            service.Setup(x => x.GetPatientById(1)).Returns(patient);
            _patientsController = new PatientsController(service.Object);

            var expectedType = typeof(RedirectToRouteResult);
            var value        = _patientsController.DeleteConfirmed(1);

            Assert.IsInstanceOfType(value, expectedType);
        }