Beispiel #1
0
        public IActionResult EventDetails(int id)
        {
            SingleModelResponse <EventViewModel> eventResponse = _context.GetEvent(id);

            if (eventResponse.DidError == true || eventResponse == null)
            {
                if (eventResponse == null)
                {
                    return(View("Error"));
                }
                Error er = new Error(eventResponse.ErrorMessage);

                return(View("Error"));
            }
            //get registered athletes
            ListModelResponse <EventRegistration> registredAthletesResponse = _evntReg.GetEventRegistrations(id);

            if (registredAthletesResponse.DidError == true || registredAthletesResponse == null)
            {
                if (registredAthletesResponse == null)
                {
                    return(View("Error"));
                }
                Error er = new Error(registredAthletesResponse.ErrorMessage);

                return(View("Error"));
            }

            if (registredAthletesResponse.Model != null)
            {
                ViewBag.RegisteredAthletes = registredAthletesResponse.Model;
            }
            return(View(eventResponse.Model));
        }
        public async Task GetEventTest()
        {
            // Arrange
            var id = "event-id";

            _stripe.Get(Arg.Is <StripeRequest <Event> >(a => a.UrlPath == "events/" + id), _cancellationToken)
            .Returns(Task.FromResult(new StripeResponse <Event>()));

            // Act
            var response = await _client.GetEvent(id, _cancellationToken);

            // Assert
            response.Should().NotBeNull();
        }