Beispiel #1
0
        public void Cancel_ServiceFailuare_Badrequest()
        {
            var expectedResult = new ServiceResult(false, "ErrorMessage");

            _mockService.Setup(m => m.CancelAppointment(1, _userId))
            .Returns(expectedResult);

            var result = _controller.Cancel(1);

            result.Should().BeOfType <BadRequestErrorMessageResult>();
            ((BadRequestErrorMessageResult)result).Message.Should().Be(expectedResult.ErrorMessage);
        }
Beispiel #2
0
        public void OnCancel()
        {
            Appointment appointment = (Appointment)_state[StateKeys.CurrentAppointment];

            _controller.Cancel(appointment, View.Reason);

            _navigator.Navigate(NavigationKeys.Home);
        }
Beispiel #3
0
        public void CancelAppointment()
        {
            mockService.Setup(x => x.CancelAppointment(1));

            AppointmentController controller = new AppointmentController(mockService.Object);

            Models.Response response = controller.Cancel(1);
            Assert.IsTrue(response.Success);
        }