public void UpdateAquisitionAverageAndStvNoTestsTest() { var testSheetDataFromDb = GetTestSheetTestDataWithAvgAndStDev(); var productionOrderDataFromDb = GetProductionOrderTestData(); var babyDiaperBll = MockHelperBll.GetTestBllForSavingAndUpdating(testSheetDataFromDb, productionOrderDataFromDb, null); var target = new InkoAquisitionServiceHelper(new NLogLoggerFactory()) { TestBll = babyDiaperBll }; var actual = target.UpdateAquisitionAverageAndStv(1); var actualAquisitionAvg = actual.TestValues.FirstOrDefault( tv => (tv.TestValueType == TestValueType.Average) && (tv.IncontinencePadTestValue.TestType == TestTypeIncontinencePad.AcquisitionTimeAndRewet)); Assert.NotNull(actualAquisitionAvg); Assert.Equal(0, actualAquisitionAvg.IncontinencePadTestValue.AcquisitionWeight); Assert.Equal(0, actualAquisitionAvg.IncontinencePadTestValue.AcquisitionTimeFirst); Assert.Equal(0, actualAquisitionAvg.IncontinencePadTestValue.AcquisitionTimeSecond); Assert.Equal(0, actualAquisitionAvg.IncontinencePadTestValue.AcquisitionTimeThird); Assert.Equal(0, actualAquisitionAvg.IncontinencePadTestValue.RewetAfterAcquisitionTimeDryWeight); Assert.Equal(0, actualAquisitionAvg.IncontinencePadTestValue.RewetAfterAcquisitionTimeWetWeight); Assert.Equal(0, actualAquisitionAvg.IncontinencePadTestValue.RewetAfterAcquisitionTimeWeightDifference); Assert.Equal(RwType.Ok, actualAquisitionAvg.IncontinencePadTestValue.AcquisitionTimeFirstRw); Assert.Equal(RwType.Ok, actualAquisitionAvg.IncontinencePadTestValue.AcquisitionTimeSecondRw); Assert.Equal(RwType.Ok, actualAquisitionAvg.IncontinencePadTestValue.AcquisitionTimeThirdRw); Assert.Equal(RwType.Ok, actualAquisitionAvg.IncontinencePadTestValue.RewetAfterAcquisitionTimeRw); var actualAquisitionStDev = actual.TestValues.FirstOrDefault( tv => (tv.TestValueType == TestValueType.StandardDeviation) && (tv.IncontinencePadTestValue.TestType == TestTypeIncontinencePad.AcquisitionTimeAndRewet)); Assert.NotNull(actualAquisitionStDev); Assert.Equal(0, actualAquisitionStDev.IncontinencePadTestValue.AcquisitionWeight); Assert.Equal(0, actualAquisitionStDev.IncontinencePadTestValue.AcquisitionTimeFirst); Assert.Equal(0, actualAquisitionStDev.IncontinencePadTestValue.AcquisitionTimeSecond); Assert.Equal(0, actualAquisitionStDev.IncontinencePadTestValue.AcquisitionTimeThird); Assert.Equal(0, actualAquisitionStDev.IncontinencePadTestValue.RewetAfterAcquisitionTimeDryWeight); Assert.Equal(0, actualAquisitionStDev.IncontinencePadTestValue.RewetAfterAcquisitionTimeWetWeight); Assert.Equal(0, actualAquisitionStDev.IncontinencePadTestValue.RewetAfterAcquisitionTimeWeightDifference); }
public void UpdateAquisitionAverageAndStvOneTestAvgTest() { var onlyTestValue = new TestValue { TestValueType = TestValueType.Single, ArticleTestType = ArticleType.BabyDiaper, IncontinencePadTestValue = new IncontinencePadTestValue { TestType = TestTypeIncontinencePad.AcquisitionTimeAndRewet, AcquisitionWeight = 21.15, AcquisitionTimeFirst = 17.12, AcquisitionTimeSecond = 54.06, AcquisitionTimeThird = 67.85, RewetAfterAcquisitionTimeDryWeight = 21.73, RewetAfterAcquisitionTimeWetWeight = 21.79, RewetAfterAcquisitionTimeWeightDifference = 0.06, AcquisitionTimeFirstRw = RwType.Ok, AcquisitionTimeSecondRw = RwType.Ok, AcquisitionTimeThirdRw = RwType.Ok, RewetAfterAcquisitionTimeRw = RwType.Ok } }; var testSheetDataFromDb = GetTestSheetTestDataWithAvgAndStDev(); testSheetDataFromDb.TestValues.Add(onlyTestValue); var productionOrderDataFromDb = GetProductionOrderTestData(); var testBll = MockHelperBll.GetTestBllForSavingAndUpdating(testSheetDataFromDb, productionOrderDataFromDb, null); var target = new InkoAquisitionServiceHelper(new NLogLoggerFactory()) { TestBll = testBll }; var actual = target.UpdateAquisitionAverageAndStv(1); var actualAquisitionAvg = actual.TestValues.FirstOrDefault( tv => (tv.TestValueType == TestValueType.Average) && (tv.IncontinencePadTestValue.TestType == TestTypeIncontinencePad.AcquisitionTimeAndRewet)); Assert.NotNull(actualAquisitionAvg); Assert.Equal(21.15, actualAquisitionAvg.IncontinencePadTestValue.AcquisitionWeight); Assert.Equal(17.12, actualAquisitionAvg.IncontinencePadTestValue.AcquisitionTimeFirst); Assert.Equal(54.06, actualAquisitionAvg.IncontinencePadTestValue.AcquisitionTimeSecond); Assert.Equal(67.85, actualAquisitionAvg.IncontinencePadTestValue.AcquisitionTimeThird); Assert.Equal(21.73, actualAquisitionAvg.IncontinencePadTestValue.RewetAfterAcquisitionTimeDryWeight); Assert.Equal(21.79, actualAquisitionAvg.IncontinencePadTestValue.RewetAfterAcquisitionTimeWetWeight); Assert.Equal(0.06, actualAquisitionAvg.IncontinencePadTestValue.RewetAfterAcquisitionTimeWeightDifference); Assert.Equal(RwType.Ok, actualAquisitionAvg.IncontinencePadTestValue.AcquisitionTimeFirstRw); Assert.Equal(RwType.Ok, actualAquisitionAvg.IncontinencePadTestValue.AcquisitionTimeSecondRw); Assert.Equal(RwType.Ok, actualAquisitionAvg.IncontinencePadTestValue.AcquisitionTimeThirdRw); Assert.Equal(RwType.Ok, actualAquisitionAvg.IncontinencePadTestValue.RewetAfterAcquisitionTimeRw); var actualAquisitionStDev = actual.TestValues.FirstOrDefault( tv => (tv.TestValueType == TestValueType.StandardDeviation) && (tv.IncontinencePadTestValue.TestType == TestTypeIncontinencePad.AcquisitionTimeAndRewet)); Assert.NotNull(actualAquisitionStDev); Assert.Equal(0, actualAquisitionStDev.IncontinencePadTestValue.AcquisitionWeight); Assert.Equal(0, actualAquisitionStDev.IncontinencePadTestValue.AcquisitionTimeFirst); Assert.Equal(0, actualAquisitionStDev.IncontinencePadTestValue.AcquisitionTimeSecond); Assert.Equal(0, actualAquisitionStDev.IncontinencePadTestValue.AcquisitionTimeThird); Assert.Equal(0, actualAquisitionStDev.IncontinencePadTestValue.RewetAfterAcquisitionTimeDryWeight); Assert.Equal(0, actualAquisitionStDev.IncontinencePadTestValue.RewetAfterAcquisitionTimeWetWeight); Assert.Equal(0, actualAquisitionStDev.IncontinencePadTestValue.RewetAfterAcquisitionTimeWeightDifference); }