Пример #1
0
        public void GetInkoRetentionEditViewModelFromNotExistingTestValueTest()
        {
            var listOfTestValues = new List <TestValue>
            {
                new TestValue {
                    TestValueId = 1, TestSheetId = 1, IncontinencePadTestValue = new IncontinencePadTestValue(), ArticleTestType = ArticleType.IncontinencePad
                }
            };
            var testSheetInDb = new TestSheet
            {
                TestSheetId     = 2,
                MachineNr       = "M49",
                CreatedDateTime = new DateTime(2016, 5, 5),
                TestValues      = listOfTestValues
            };

            foreach (var testValue in listOfTestValues)
            {
                testValue.TestSheet = testSheetInDb;
            }

            var testBll =
                MockHelperBll.GetTestBll(
                    testSheetInDb
                    );

            var target = new InkoRetentionService(new NLogLoggerFactory())
            {
                TestBll = testBll
            };

            var actual = target.GetInkoRetentionEditViewModel(2);

            Assert.Equal(null, actual);
        }
Пример #2
0
        public void GetNewInkoRetentionEditViewModelFromExistingTestSheetTest()
        {
            var testSheetInDb = new TestSheet
            {
                TestSheetId     = 2,
                MachineNr       = "M49",
                CreatedDateTime = new DateTime(2016, 5, 5),
                ArticleType     = ArticleType.IncontinencePad
            };
            var testBll =
                MockHelperBll.GetTestBll(
                    testSheetInDb
                    );

            var testServiceHelper = MockHelperTestServiceHelper.GetTestServiceHelper("IT/49/16/");

            var target = new InkoRetentionService(new NLogLoggerFactory())
            {
                TestBll           = testBll,
                TestServiceHelper = testServiceHelper
            };

            var actual = target.GetNewInkoRetentionEditViewModel(2);

            Assert.Equal(testSheetInDb.TestSheetId, actual.TestSheetId);
            Assert.Equal(-1, actual.TestValueId);
            Assert.Equal("IT/49/16/", actual.ProductionCode);
        }
Пример #3
0
        public void GetInkoRewetEditViewModelWithNoBabyDiaperTestVauleTest()
        {
            var listOfTestValues = new List <TestValue>
            {
                new TestValue {
                    TestValueId = 1, TestSheetId = 1
                }
            };
            var testSheetInDb = new TestSheet
            {
                TestSheetId     = 1,
                MachineNr       = "M49",
                CreatedDateTime = new DateTime(2016, 5, 5),
                TestValues      = listOfTestValues
            };

            foreach (var testValue in listOfTestValues)
            {
                testValue.TestSheet = testSheetInDb;
            }

            var testBll =
                MockHelperBll.GetTestBll(
                    testSheetInDb
                    );

            var target = new InkoRewetService(new NLogLoggerFactory())
            {
                TestBll = testBll
            };

            var actual = target.GetInkoRewetEditViewModel(1);

            Assert.Equal(null, actual);
        }
Пример #4
0
        public void GetBabyDiaperRewetEditViewModelFromNotExistingTestValueTest()
        {
            var listOfTestValues = new List <TestValue>
            {
                new TestValue {
                    TestValueId = 1, TestSheetId = 1, BabyDiaperTestValue = new BabyDiaperTestValue()
                }
            };
            var testSheetInDb = new TestSheet
            {
                TestSheetId     = 1,
                MachineNr       = "M11",
                CreatedDateTime = new DateTime(2016, 5, 5),
                TestValues      = listOfTestValues
            };

            foreach (var testValue in listOfTestValues)
            {
                testValue.TestSheet = testSheetInDb;
            }

            var babyDiaperRetentionBll =
                MockHelperBll.GetTestBll(
                    testSheetInDb
                    );

            var target = new BabyDiaperRewetService(new NLogLoggerFactory())
            {
                TestBll = babyDiaperRetentionBll
            };

            var actual = target.GetBabyDiaperRewetEditViewModel(2);

            Assert.Equal(null, actual);
        }
Пример #5
0
        public void GetNewBabyDiaperRewetEditViewModelFromExistingTestSheetTest()
        {
            var testSheetInDb = new TestSheet
            {
                TestSheetId     = 1,
                MachineNr       = "M11",
                CreatedDateTime = new DateTime(2016, 5, 5)
            };
            var babyDiaperRetentionBll =
                MockHelperBll.GetTestBll(
                    testSheetInDb
                    );

            var babyDiaperServiceHelper = MockHelperTestServiceHelper.GetTestServiceHelper("IT/11/16/");

            var target = new BabyDiaperRewetService(new NLogLoggerFactory())
            {
                TestBll           = babyDiaperRetentionBll,
                TestServiceHelper = babyDiaperServiceHelper
            };

            var actual = target.GetNewBabyDiaperRewetEditViewModel(1);

            Assert.Equal(testSheetInDb.TestSheetId, actual.TestSheetId);
            Assert.Equal(-1, actual.TestValueId);
            Assert.Equal("IT/11/16/", actual.ProductionCode);
        }
        public void GetBabyDiaperRetentionEditViewModelTest()
        {
            var listOfTestValues = new List <TestValue>
            {
                new TestValue
                {
                    TestValueId                = 1,
                    TestSheetId                = 1,
                    LastEditedPerson           = "Hans",
                    DayInYearOfArticleCreation = 123,
                    BabyDiaperTestValue        =
                        new BabyDiaperTestValue
                    {
                        DiaperCreatedTime  = new TimeSpan(5, 10, 0),
                        WeightDiaperDry    = 32.2,
                        RetentionWetWeight = 398.1,
                        TestType           = TestTypeBabyDiaper.Retention
                    }
                }
            };
            var testSheetInDb = new TestSheet
            {
                TestSheetId     = 1,
                MachineNr       = "M11",
                CreatedDateTime = new DateTime(2016, 5, 5),
                TestValues      = listOfTestValues
            };

            foreach (var testValue in listOfTestValues)
            {
                testValue.TestSheet = testSheetInDb;
            }

            var babyDiaperRetentionBll =
                MockHelperBll.GetTestBll(
                    testSheetInDb
                    );

            var babyDiaperServiceHelper = MockHelperTestServiceHelper.GetTestServiceHelper("IT/11/16/");

            var target = new BabyDiaperRetentionService(new NLogLoggerFactory())
            {
                TestBll           = babyDiaperRetentionBll,
                TestServiceHelper = babyDiaperServiceHelper
            };

            var actual = target.GetBabyDiapersRetentionEditViewModel(1);

            Assert.Equal(testSheetInDb.TestSheetId, actual.TestSheetId);
            Assert.Equal(1, actual.TestValueId);
            Assert.Equal("IT/11/16/", actual.ProductionCode);
            Assert.Equal("Hans", actual.TestPerson);
            Assert.Equal(123, actual.ProductionCodeDay);
            Assert.Equal(new TimeSpan(5, 10, 0), actual.ProductionCodeTime);
            Assert.Equal(32.2, actual.DiaperWeight);
            Assert.Equal(398.1, actual.WeightRetentionWet);
            Assert.Equal(2,
                         actual.NoteCodes.ToList()
                         .Count);
        }
Пример #7
0
        public void GetNewInkoRetentionEditViewModelFromNotExistingTestSheetTest()
        {
            var testBll =
                MockHelperBll.GetTestBll(
                    new TestSheet {
                TestSheetId = 1
            }
                    );

            var target = new InkoRetentionService(new NLogLoggerFactory())
            {
                TestBll = testBll
            };

            var actual = target.GetNewInkoRetentionEditViewModel(2);

            Assert.Equal(null, actual);
        }
Пример #8
0
        public void GetInkoRetentionEditViewModelTest()
        {
            var listOfTestValues = new List <TestValue>
            {
                new TestValue
                {
                    TestValueId                = 1,
                    TestSheetId                = 1,
                    LastEditedPerson           = "Hans",
                    DayInYearOfArticleCreation = 123,
                    IncontinencePadTestValue   =
                        new IncontinencePadTestValue
                    {
                        IncontinencePadTime      = new TimeSpan(5, 10, 0),
                        RetentionWeight          = 30,
                        RetentionWetValue        = 400.2,
                        RetentionAfterZentrifuge = 200,
                        RetentionAbsorbtion      = 380.2,
                        RetentionEndValue        = 190,
                        RetentionRw = RwType.Ok,
                        TestType    = TestTypeIncontinencePad.Retention
                    }
                }
            };
            var testSheetInDb = new TestSheet
            {
                TestSheetId     = 1,
                MachineNr       = "M49",
                CreatedDateTime = new DateTime(2016, 5, 5),
                TestValues      = listOfTestValues
            };

            foreach (var testValue in listOfTestValues)
            {
                testValue.TestSheet = testSheetInDb;
            }

            var testBll =
                MockHelperBll.GetTestBll(
                    testSheetInDb
                    );

            var testServiceHelper = MockHelperTestServiceHelper.GetTestServiceHelper("IT/49/16/");

            var target = new InkoRetentionService(new NLogLoggerFactory())
            {
                TestBll           = testBll,
                TestServiceHelper = testServiceHelper
            };

            var actual = target.GetInkoRetentionEditViewModel(1);

            Assert.Equal(testSheetInDb.TestSheetId, actual.TestSheetId);
            Assert.Equal(1, actual.TestValueId);
            Assert.Equal("IT/49/16/", actual.ProductionCode);
            Assert.Equal("Hans", actual.TestPerson);
            Assert.Equal(123, actual.ProductionCodeDay);
            Assert.Equal(new TimeSpan(5, 10, 0), actual.ProductionCodeTime);
            Assert.Equal(30, actual.InkoWeight);
            Assert.Equal(400.2, actual.InkoWeightWet);
            Assert.Equal(200, actual.InkoWeightAfterZentrifuge);
            Assert.Equal(2,
                         actual.NoteCodes.ToList()
                         .Count);
        }
Пример #9
0
        public void GetInkoRewetEditViewModelRewetOnlyTest()
        {
            var listOfTestValues = new List <TestValue>
            {
                new TestValue
                {
                    TestValueId                = 1,
                    TestSheetId                = 1,
                    LastEditedPerson           = "Hans",
                    DayInYearOfArticleCreation = 123,
                    IncontinencePadTestValue   =
                        new IncontinencePadTestValue
                    {
                        IncontinencePadTime = new TimeSpan(5, 10, 0),
                        RewetFreeDryValue   = 20,
                        RewetFreeWetValue   = 20.5,
                        RewetFreeDifference = 0.5,
                        RewetFreeRw         = RwType.Ok,
                        TestType            = TestTypeIncontinencePad.RewetFree
                    }
                }
            };
            var testSheetInDb = new TestSheet
            {
                TestSheetId     = 1,
                MachineNr       = "M49",
                CreatedDateTime = new DateTime(2016, 5, 5),
                TestValues      = listOfTestValues
            };

            foreach (var testValue in listOfTestValues)
            {
                testValue.TestSheet = testSheetInDb;
            }

            var testBll =
                MockHelperBll.GetTestBll(
                    testSheetInDb
                    );

            var testServiceHelper = MockHelperTestServiceHelper.GetTestServiceHelper("IT/49/16/");

            var target = new InkoRewetService(new NLogLoggerFactory())
            {
                TestBll           = testBll,
                TestServiceHelper = testServiceHelper
            };

            var actual = target.GetInkoRewetEditViewModel(1);

            Assert.Equal(testSheetInDb.TestSheetId, actual.TestSheetId);
            Assert.Equal(1, actual.TestValueId);
            Assert.Equal("IT/49/16/", actual.ProductionCode);
            Assert.Equal("Hans", actual.TestPerson);
            Assert.Equal(123, actual.ProductionCodeDay);
            Assert.Equal(new TimeSpan(5, 10, 0), actual.ProductionCodeTime);
            Assert.Equal(20, actual.FPDry);
            Assert.Equal(20.5, actual.FPWet);
            Assert.Equal(2,
                         actual.NoteCodes.ToList()
                         .Count);
        }
Пример #10
0
        public void GetBabyDiaperRewetEditViewModelRewetAndPenetrationTest()
        {
            var listOfTestValues = new List <TestValue>
            {
                new TestValue
                {
                    TestValueId                = 1,
                    TestSheetId                = 1,
                    LastEditedPerson           = "Hans",
                    DayInYearOfArticleCreation = 123,
                    BabyDiaperTestValue        =
                        new BabyDiaperTestValue
                    {
                        DiaperCreatedTime             = new TimeSpan(5, 10, 0),
                        WeightDiaperDry               = 32.2,
                        Rewet140Value                 = 0.01,
                        Rewet210Value                 = 0.1,
                        StrikeTroughValue             = 0.3,
                        DistributionOfTheStrikeTrough = 250,
                        PenetrationTimeAdditionFirst  = 1,
                        PenetrationTimeAdditionSecond = 2,
                        PenetrationTimeAdditionThird  = 3,
                        PenetrationTimeAdditionFourth = 4,
                        TestType = TestTypeBabyDiaper.RewetAndPenetrationTime
                    }
                }
            };
            var testSheetInDb = new TestSheet
            {
                TestSheetId     = 1,
                MachineNr       = "M11",
                CreatedDateTime = new DateTime(2016, 5, 5),
                TestValues      = listOfTestValues
            };

            foreach (var testValue in listOfTestValues)
            {
                testValue.TestSheet = testSheetInDb;
            }

            var babyDiaperRetentionBll =
                MockHelperBll.GetTestBll(
                    testSheetInDb
                    );

            var babyDiaperServiceHelper = MockHelperTestServiceHelper.GetTestServiceHelper("IT/11/16/");

            var target = new BabyDiaperRewetService(new NLogLoggerFactory())
            {
                TestBll           = babyDiaperRetentionBll,
                TestServiceHelper = babyDiaperServiceHelper
            };

            var actual = target.GetBabyDiaperRewetEditViewModel(1);

            Assert.Equal(testSheetInDb.TestSheetId, actual.TestSheetId);
            Assert.Equal(1, actual.TestValueId);
            Assert.Equal("IT/11/16/", actual.ProductionCode);
            Assert.Equal("Hans", actual.TestPerson);
            Assert.Equal(123, actual.ProductionCodeDay);
            Assert.Equal(new TimeSpan(5, 10, 0), actual.ProductionCodeTime);
            Assert.Equal(32.2, actual.DiaperWeight);
            Assert.Equal(0.01, actual.RewetAfter140);
            Assert.Equal(0.1, actual.RewetAfter210);
            Assert.Equal(0.3, actual.StrikeThrough);
            Assert.Equal(250, actual.Distribution);
            Assert.Equal(TestTypeBabyDiaper.RewetAndPenetrationTime, actual.TestType);
            Assert.Equal(1, actual.PenetrationTime1);
            Assert.Equal(2, actual.PenetrationTime2);
            Assert.Equal(3, actual.PenetrationTime3);
            Assert.Equal(4, actual.PenetrationTime4);
            Assert.Equal(2,
                         actual.NoteCodes.ToList()
                         .Count);
        }
        public void GetInkoAquisitionEditViewModelTest()
        {
            var listOfTestValues = new List <TestValue>
            {
                new TestValue
                {
                    TestValueId                = 1,
                    TestSheetId                = 1,
                    LastEditedPerson           = "Hans",
                    DayInYearOfArticleCreation = 123,
                    IncontinencePadTestValue   =
                        new IncontinencePadTestValue
                    {
                        IncontinencePadTime                       = new TimeSpan(5, 10, 0),
                        AcquisitionTimeFirst                      = 10,
                        AcquisitionTimeFirstRw                    = RwType.Ok,
                        AcquisitionTimeSecond                     = 20,
                        AcquisitionTimeSecondRw                   = RwType.Ok,
                        AcquisitionTimeThird                      = 30,
                        AcquisitionTimeThirdRw                    = RwType.Ok,
                        AcquisitionWeight                         = 20.2,
                        RewetAfterAcquisitionTimeDryWeight        = 12.5,
                        RewetAfterAcquisitionTimeWetWeight        = 13,
                        RewetAfterAcquisitionTimeWeightDifference = 0.5,
                        RewetAfterAcquisitionTimeRw               = RwType.Ok,
                        TestType = TestTypeIncontinencePad.AcquisitionTimeAndRewet
                    }
                }
            };
            var testSheetInDb = new TestSheet
            {
                TestSheetId     = 1,
                MachineNr       = "M49",
                CreatedDateTime = new DateTime(2016, 5, 5),
                TestValues      = listOfTestValues
            };

            foreach (var testValue in listOfTestValues)
            {
                testValue.TestSheet = testSheetInDb;
            }

            var testBll =
                MockHelperBll.GetTestBll(
                    testSheetInDb
                    );

            var testServiceHelper = MockHelperTestServiceHelper.GetTestServiceHelper("IT/49/16/");

            var target = new InkoAquisitionService(new NLogLoggerFactory())
            {
                TestBll           = testBll,
                TestServiceHelper = testServiceHelper
            };

            var actual = target.GetInkoAquisitionEditViewModel(1);

            Assert.Equal(testSheetInDb.TestSheetId, actual.TestSheetId);
            Assert.Equal(1, actual.TestValueId);
            Assert.Equal("IT/49/16/", actual.ProductionCode);
            Assert.Equal("Hans", actual.TestPerson);
            Assert.Equal(123, actual.ProductionCodeDay);
            Assert.Equal(new TimeSpan(5, 10, 0), actual.ProductionCodeTime);
            Assert.Equal(20.2, actual.InkoWeight);
            Assert.Equal(10, actual.AquisitionAddition1);
            Assert.Equal(20, actual.AquisitionAddition2);
            Assert.Equal(30, actual.AquisitionAddition3);
            Assert.Equal(12.5, actual.FPDry);
            Assert.Equal(13, actual.FPWet);
            Assert.Equal(2,
                         actual.NoteCodes.ToList()
                         .Count);
        }