public void GetHistoryViewModelNoTestSheetTest() { var historyBll = MockHelperBll.GetHistoryBll( new List <TestSheet>() ); var target = new HistoryService(new NLogLoggerFactory()) { HistoryBll = historyBll }; var actual = target.GetHistoryViewModel("FA123456"); Assert.Equal("Kein Eintrag mit Fertigunsnummer FA123456 gefunden.", actual.Message); }
public void GetHistoryViewModelDbFailTest() { var historyBll = MockHelperBll.GetHistoryBll( null ); var target = new HistoryService(new NLogLoggerFactory()) { HistoryBll = historyBll }; var actual = target.GetHistoryViewModel("FA123456"); Assert.Equal("Es ist ein Problem aufgetreten. Bitte wenden Sie sich an ihren Administrator", actual.Message); }
public void GetHistoryViewModelBaseTest() { var testSheetsInDb = new List <TestSheet> { new TestSheet { FaNr = "FA123456", ShiftType = ShiftType.Night, ArticleType = ArticleType.BabyDiaper, TestValues = new List <TestValue> { new TestValue { TestValueType = TestValueType.Average, ArticleTestType = ArticleType.BabyDiaper, BabyDiaperTestValue = new BabyDiaperTestValue { TestType = TestTypeBabyDiaper.Retention, RetentionRw = RwType.Ok } } } } }; var historyBll = MockHelperBll.GetHistoryBll( testSheetsInDb ); var target = new HistoryService(new NLogLoggerFactory()) { HistoryBll = historyBll }; var actual = target.GetHistoryViewModel("FA123456"); Assert.Equal(1, actual.Sheets.Count); }
public void GetHistoryViewModelOneTestSheetWorseTest() { var testSheetsInDb = new List <TestSheet> { new TestSheet { FaNr = "FA123456", ShiftType = ShiftType.Night, ArticleType = ArticleType.BabyDiaper, TestValues = new List <TestValue> { new TestValue { TestValueType = TestValueType.Average, ArticleTestType = ArticleType.BabyDiaper, BabyDiaperTestValue = new BabyDiaperTestValue { TestType = TestTypeBabyDiaper.Retention, RetentionRw = RwType.Worse } }, new TestValue { TestValueType = TestValueType.Average, ArticleTestType = ArticleType.BabyDiaper, BabyDiaperTestValue = new BabyDiaperTestValue { TestType = TestTypeBabyDiaper.Rewet, Rewet140Rw = RwType.SomethingWorse, Rewet210Rw = RwType.Ok } }, new TestValue { TestValueType = TestValueType.Average, ArticleTestType = ArticleType.BabyDiaper, BabyDiaperTestValue = new BabyDiaperTestValue { TestType = TestTypeBabyDiaper.RewetAndPenetrationTime, Rewet140Rw = RwType.Ok, Rewet210Rw = RwType.Ok, PenetrationRwType = RwType.Ok } } } } }; var historyBll = MockHelperBll.GetHistoryBll( testSheetsInDb ); var target = new HistoryService(new NLogLoggerFactory()) { HistoryBll = historyBll }; var actual = target.GetHistoryViewModel("FA123456"); Assert.Equal(RwType.Worse, actual.Sheets.First() .RwType); }