public void GetEventTypeById_NonExistingValue_ShouldNotReturnValue(int eventTypeId) { using (var scope = _iContainer.BeginLifetimeScope(AppContextType.UnitTest.ToString())) { _iEventTypeDal = scope.Resolve <IEventTypeDal>(); var eventType = _iEventTypeDal.GetEventTypeById(eventTypeId); Assert.True(eventType == null); } }
/// <summary> /// Select EventType by Event Type Id /// </summary> /// <param name="eventTypeId">int object</param> /// <returns>Json object</returns> public string GetEventTypeById(int eventTypeId) { try { var eventType = _iEventTypeDal.GetEventTypeById(eventTypeId); return(JsonConvert.SerializeObject(eventType)); } catch (Exception ex) { log.Error($"Exception in Method GetEventTypeById for id - {eventTypeId}", ex); throw; } }