Esempio n. 1
0
        private async Task GetEventAsync()
        {
            Event = await EventAppService.GetAsync(Guid.Parse(Id));

            if (CurrentUser.IsAuthenticated)
            {
                IsRegistered = Event.Attendees.Any(a => a.UserId == CurrentUser.Id);
            }
        }
Esempio n. 2
0
        private async Task Delete()
        {
            if (!await MessageService.ConfirmAsync("This event will be deleted: " + Event.Title))
            {
                return;
            }

            await EventAppService.DeleteAsync(Guid.Parse(Id));

            NavigationManager.NavigateTo("/");
        }
Esempio n. 3
0
        public EventAppService GetEventAppService()
        {
            Mocker = new AutoMocker();

            Mocker.Use(new MapperConfiguration(ps =>
            {
                ps.AddProfile(new EventMapper());
            }).CreateMapper());

            EventAppService = Mocker.CreateInstance <EventAppService>();

            return(EventAppService);
        }
Esempio n. 4
0
        public void EventAppServiceStartup()
        {
            accountAppService = new AccountAppService();
            eventAppService   = new EventAppService();
            host = accountAppService.Find("TestHost", "TestHost");



            EventViewModel eventViewModel = new EventViewModel();

            eventViewModel.HostId   = host.Id;
            eventViewModel.Name     = "TestEvent1";
            eventViewModel.location = "Test";
            eventViewModel.price    = 4;
            eventViewModel.TotalAvailableTickets = 5;
            eventViewModel.category = 0;
            eventViewModel.date     = DateTime.Now;
            Event1 = eventAppService.SaveNewEvent(eventViewModel);
        }
Esempio n. 5
0
        private async Task Create()
        {
            var id = await EventAppService.CreateAsync(Event);

            NavigationManager.NavigateTo("/events/" + id);
        }
Esempio n. 6
0
        private async Task UnRegister()
        {
            await EventAppService.UnRegisterAsync(Guid.Parse(Id));

            await GetEventAsync();
        }
 public EventAppServiceTests()
 {
     _fixture         = new EventAppServiceFixture();
     _eventAppService = _fixture.GetEventAppService();
 }