コード例 #1
0
        public void GetNewBabyDiaperRetentionEditViewModelFromExistingTestSheetTest()
        {
            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 BabyDiaperRetentionService(new NLogLoggerFactory())
            {
                TestBll           = babyDiaperRetentionBll,
                TestServiceHelper = babyDiaperServiceHelper
            };

            var actual = target.GetNewBabyDiapersRetentionEditViewModel(1);

            Assert.Equal(testSheetInDb.TestSheetId, actual.TestSheetId);
            Assert.Equal(-1, actual.TestValueId);
            Assert.Equal("IT/11/16/", actual.ProductionCode);
        }
コード例 #2
0
        public void GetNewBabyDiaperRetentionEditViewModelFromNotExistingTestSheetTest()
        {
            var babyDiaperRetentionBll =
                MockHelperBll.GetTestBll(
                    new TestSheet {
                TestSheetId = 1
            }
                    );

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

            var actual = target.GetNewBabyDiapersRetentionEditViewModel(2);

            Assert.Equal(null, actual);
        }