/// <summary> /// Gets the IncontinencePadTestValue out of a list of testvalues for the correct /// <see cref="TestTypeIncontinencePad" /> and /// <see cref="TestValueType" /> /// One must exists and only one. /// </summary> /// <param name="testValues">the test values containing the wanted item</param> /// <param name="testTypeIncontinencePad">the type of the incontinence pad. <see cref="TestTypeIncontinencePad" /></param> /// <param name="testValueType">the value type of the incontinence pad. <see cref="TestValueType" /></param> /// <returns></returns> public IncontinencePadTestValue GetIncontinencePadTestValueForType(IEnumerable <TestValue> testValues, TestTypeIncontinencePad testTypeIncontinencePad, TestValueType testValueType) { var values = testValues.ToList() .Where( x => (x.TestValueType == testValueType) && (x.IncontinencePadTestValue.TestType == testTypeIncontinencePad)) .ToList(); var item = ValidateTestValueOnlyExactlyOneHasToExist(values, testTypeIncontinencePad.ToString(), testValueType.ToString()); return(item.IncontinencePadTestValue); }
private TestValue CreateDefaultTestValueIncontinencePad( TestValueType testValueType, TestTypeIncontinencePad testTypeIncontinencePad ) => new TestValue { ArticleTestType = ArticleType.IncontinencePad, CreatedDateTime = DateTime.Now, CreatedPerson = "system", LastEditedDateTime = DateTime.Now, TestValueType = testValueType, LastEditedPerson = "system", DayInYearOfArticleCreation = DateTime.Now.DayOfYear, IncontinencePadTestValue = new IncontinencePadTestValue { TestType = testTypeIncontinencePad, AcquisitionTimeFirstRw = RwType.Ok, AcquisitionTimeSecondRw = RwType.Ok, AcquisitionTimeThirdRw = RwType.Ok, RetentionRw = RwType.Ok, RewetFreeRw = RwType.Ok } };