Ejemplo n.º 1
0
        public void Constructor_GivenNullTedsSex_ThrowsException()
        {
            // Setup
            TedsAnswer <TedsGender> tedsSex = null;

            // Exercise
            new TedsGenderInformation(tedsSex, null);

            // Verify
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Maps the type of to teds non response.
        /// </summary>
        /// <typeparam name="T">The type of the value.</typeparam>
        /// <param name="tedsAnswerDto">The teds non response type dto.</param>
        /// <param name="mappingHelper">The mapping helper.</param>
        /// <returns>A <see cref="TedsAnswer{T}"/></returns>
        public static TedsAnswer <T> MapToTedsAnswer <T> (
            TedsAnswerDto <T> tedsAnswerDto, IDtoToDomainMappingHelper mappingHelper)
        {
            TedsAnswer <T> result = null;

            if (tedsAnswerDto != null)
            {
                if (!typeof(T).IsNullable() || tedsAnswerDto.Response != null || tedsAnswerDto.TedsNonResponse != null)
                {
                    result = tedsAnswerDto.TedsNonResponse != null
                                 ? new TedsAnswer <T> (
                        mappingHelper.MapLookupField <TedsNonResponse> (tedsAnswerDto.TedsNonResponse))
                                 : new TedsAnswer <T> (tedsAnswerDto.Response);
                }
            }
            else
            {
                throw new InvalidOperationException("TedsAnswerDto Cannot be Null.");
            }

            return(result);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Maps to teds answer.
        /// </summary>
        /// <typeparam name="TLookupBase">The type of the lookup base.</typeparam>
        /// <typeparam name="TLookupValueDto">The type of the lookup value dto.</typeparam>
        /// <param name="tedsAnswerDto">The teds answer dto.</param>
        /// <param name="mappingHelper">The mapping helper.</param>
        /// <returns>A <see cref="TedsAnswer{T}"/></returns>
        public static TedsAnswer <TLookupBase> MapToTedsAnswer <TLookupBase, TLookupValueDto> (
            TedsAnswerDto <TLookupValueDto> tedsAnswerDto, IDtoToDomainMappingHelper mappingHelper)
            where TLookupBase : LookupBase
            where TLookupValueDto : LookupValueDto
        {
            TedsAnswer <TLookupBase> result = null;

            if (tedsAnswerDto != null)
            {
                if (tedsAnswerDto.Response != null || tedsAnswerDto.TedsNonResponse != null)
                {
                    result = tedsAnswerDto.TedsNonResponse != null
                                 ? new TedsAnswer <TLookupBase>(
                        mappingHelper.MapLookupField <TedsNonResponse> (tedsAnswerDto.TedsNonResponse))
                                 : new TedsAnswer <TLookupBase>(mappingHelper.MapLookupField <TLookupBase>(tedsAnswerDto.Response));
                }
            }
            else
            {
                throw new InvalidOperationException("TedsAnswerDto Cannot be Null.");
            }

            return(result);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Revises the teds discharge reason.
 /// </summary>
 /// <param name="tedsDischargeReason">The teds discharge reason.</param>
 public virtual void ReviseTedsDischargeReason(TedsAnswer<TedsDischargeReason> tedsDischargeReason)
 {
     //CheckIfTedsAnswerHasInvalidNonResponse(tedsDischargeReason, () => TedsDischargeReason, "Discharge reason");
     TedsDischargeReason = tedsDischargeReason;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Revises the type of the participated self help group in past thirty days.
 /// </summary>
 /// <param name="participatedSelfHelpGroupInPastThirtyDaysType">Type of the participated self help group in past thirty days.</param>
 public virtual void ReviseParticipatedSelfHelpGroupInPastThirtyDaysType(TedsAnswer<ParticipatedSelfHelpGroupInPastThirtyDaysType> participatedSelfHelpGroupInPastThirtyDaysType)
 {
     //CheckIfTedsAnswerHasInvalidNonResponse(frequencyOfAttendanceAtSelfHelpProgramsType, () => ParticipatedSelfHelpGroupInPastThirtyDaysType, "Frequency of attendance at self help programs");
     ParticipatedSelfHelpGroupInPastThirtyDaysType = participatedSelfHelpGroupInPastThirtyDaysType;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Revises the type of the living arrangements.
 /// </summary>
 /// <param name="livingArrangementsType">Type of the living arrangements.</param>
 public virtual void ReviseLivingArrangementsType( TedsAnswer<LivingArrangementsType>  livingArrangementsType)
 {
     //CheckIfTedsAnswerHasInvalidNonResponse(livingArrangementsType, () => LivingArrangementsType, "Living arrangement type");
     LivingArrangementsType = livingArrangementsType;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Revises the arrests in past thirty days count.
 /// </summary>
 /// <param name="arrestsInPastThirtyDaysCount">The arrests in past thirty days count.</param>
 public virtual void ReviseArrestsInPastThirtyDaysCount(TedsAnswer<int?> arrestsInPastThirtyDaysCount)
 {
     ArrestsInPastThirtyDaysCount = arrestsInPastThirtyDaysCount;
 }