public void Invasive_IsCalculated_AccordingToSamplingLocation(MeningoSamplingLocation samplingLocation, YesNo expectedInvasive) { var meningoSending = new MeningoSending { SamplingLocation = samplingLocation }; meningoSending.Invasive.Should().Be(expectedInvasive); }
private static string ExportSamplingLocation(MeningoSamplingLocation samplingLocation, MeningoSending sending) { return samplingLocation == MeningoSamplingLocation.OtherInvasive ? sending.OtherInvasiveSamplingLocation : samplingLocation == MeningoSamplingLocation.OtherNonInvasive ? sending.OtherNonInvasiveSamplingLocation : ExportToString(samplingLocation); }
public static bool IsInvasive(MeningoSamplingLocation samplingLocation) { return(samplingLocation.GetType().GetField(Enum.GetName(samplingLocation.GetType(), samplingLocation)).GetCustomAttributes(typeof(InvasiveSamplingLocationAttribute), false).Length > 0); }