Example #1
0
        public async Task <IHttpActionResult> GetEventTypes()
        {
            var organizationId = GetUserAndOrganization().OrganizationId;
            var types          = await _eventUtilitiesService.GetEventTypesAsync(organizationId);

            var result = _mapper.Map <IEnumerable <EventTypeDto>, IEnumerable <EventTypeViewModel> >(types);

            return(Ok(result));
        }
Example #2
0
        public async Task Should_Return_Correctly_Mapped_Event_Types()
        {
            MockEventTypes();
            const int organizationId = 2;

            var result = (await _eventUtilitiesService.GetEventTypesAsync(organizationId)).ToList();

            Assert.AreEqual(result.Count, 3);
            Assert.AreEqual(result.First(x => x.Id == 1).Name, "type1");
        }