Index: vhUnitTest/APPS/Halux/Planning/Pitching/impl/BatchPitchDataExporter/ExporteerBatchPitchedDataNaarObjective/Test.cls.xml =================================================================== diff -u -r71506 -r71507 --- vhUnitTest/APPS/Halux/Planning/Pitching/impl/BatchPitchDataExporter/ExporteerBatchPitchedDataNaarObjective/Test.cls.xml (.../Test.cls.xml) (revision 71506) +++ vhUnitTest/APPS/Halux/Planning/Pitching/impl/BatchPitchDataExporter/ExporteerBatchPitchedDataNaarObjective/Test.cls.xml (.../Test.cls.xml) (revision 71507) @@ -9,16 +9,10 @@ #dim IsReedsGestart As %Boolean = $$$False Set BatchMock = ##class(vhTest.Mock.APPS.Halux.common.Batch).%New() - Do BatchMock.VerwachtMethodCall("IsReedsGestart").ExactAantalKeer(1).DanReturn(IsReedsGestart) - Do BatchMock.VerwachtMethodCall("GeefID").ExactAantalKeer(0).DanReturn(DummyBatchId) - - Set DummyBatchPitchedDto = ##class(APPS.Halux.Planning.Pitching.dto.BatchPitched).%New() - Set DummyBatchPitchedDto.Batch = BatchMock - - Set BatchesPitchedLijst = ##class(%ListOfObjects).%New() - Do BatchesPitchedLijst.Insert(DummyBatchPitchedDto) - Set BatchesPitched = ##class(TECH.ListIterator).%New(BatchesPitchedLijst) - + Do BatchMock.VerwachtMethodCall("IsReedsGestart").DanReturn(IsReedsGestart) + Do BatchMock.VerwachtMethodCall("GeefID").ExactAantalKeer(0) + + #dim BatchesPitched As TECH.ListIterator = ..GeefBatchesPitchedIterator(BatchMock) Set BatchPitchedRepositoryMock = ##class(vhTest.Mock.APPS.Halux.Planning.Pitching.impl.BatchPitchedRepository).%New() Do BatchPitchedRepositoryMock.VerwachtMethodCall("ZoekAlle").ExactAantalKeer(1).DanReturn(BatchesPitched) @@ -37,28 +31,15 @@ #dim IsExported As %Boolean = $$$True Set BatchMock = ##class(vhTest.Mock.APPS.Halux.common.Batch).%New() - Do BatchMock.VerwachtMethodCall("IsReedsGestart").ExactAantalKeer(1).DanReturn(IsReedsGestart) - Do BatchMock.VerwachtMethodCall("GeefID").ExactAantalKeer(1).DanReturn(DummyBatchId) + Do BatchMock.VerwachtMethodCall("IsReedsGestart").DanReturn(IsReedsGestart) + Do BatchMock.VerwachtMethodCall("GeefID").DanReturn(DummyBatchId) Do BatchMock.VerwachtMethodCall("GeefCategorie").ExactAantalKeer(0) - - Set DummyBatchPitchedDto = ##class(APPS.Halux.Planning.Pitching.dto.BatchPitched).%New() - Set DummyBatchPitchedDto.Batch = BatchMock - - Set BatchesPitchedLijst = ##class(%ListOfObjects).%New() - Do BatchesPitchedLijst.Insert(DummyBatchPitchedDto) - Set BatchesPitched = ##class(TECH.ListIterator).%New(BatchesPitchedLijst) - - Set BatchExportedDto = ##class(APPS.Halux.Planning.Pitching.dto.BatchPitchExported).%New() - Set BatchExportedDto.BatchId = DummyBatchId - Set BatchExportedDto.IsExported = IsExported - - Set BatchesExportedLijst = ##class(%ListOfObjects).%New() - Do BatchesExportedLijst.Insert(BatchExportedDto) - Set BatchesExported = ##class(TECH.ListIterator).%New(BatchesExportedLijst) - + + #dim BatchesPitched As TECH.ListIterator = ..GeefBatchesPitchedIterator(BatchMock) Set BatchPitchedRepositoryMock = ##class(vhTest.Mock.APPS.Halux.Planning.Pitching.impl.BatchPitchedRepository).%New() Do BatchPitchedRepositoryMock.VerwachtMethodCall("ZoekAlle").ExactAantalKeer(1).DanReturn(BatchesPitched) + #dim BatchesExported As TECH.ListIterator = ..GeefBatchesExportedIterator(DummyBatchId, IsExported) Set BatchPitchExportRepositoryMock = ##class(vhTest.Mock.APPS.Halux.Planning.Pitching.impl.BatchPitchExportedRepository).%New() Do BatchPitchExportRepositoryMock.VerwachtMethodCall("ZoekViaBatchId", DummyBatchId).ExactAantalKeer(1).DanReturn(BatchesExported) @@ -78,36 +59,21 @@ #dim IsExported As %Boolean = $$$False Set BatchMock = ##class(vhTest.Mock.APPS.Halux.common.Batch).%New() - Do BatchMock.VerwachtMethodCall("IsReedsGestart").ExactAantalKeer(1).DanReturn(IsReedsGestart) - Do BatchMock.VerwachtMethodCall("GeefID").ExactAantalKeer(3).DanReturn(DummyBatchId) + Do BatchMock.VerwachtMethodCall("IsReedsGestart").DanReturn(IsReedsGestart) + Do BatchMock.VerwachtMethodCall("GeefID").DanReturn(DummyBatchId) Do BatchMock.VerwachtMethodCall("GeefCategorie").ExactAantalKeer(1).DanReturn("Legrabox") - Set DummyBatchPitchedDto = ##class(APPS.Halux.Planning.Pitching.dto.BatchPitched).%New() - Set DummyBatchPitchedDto.Batch = BatchMock - - Set BatchesPitchedLijst = ##class(%ListOfObjects).%New() - Do BatchesPitchedLijst.Insert(DummyBatchPitchedDto) - Set BatchesPitched = ##class(TECH.ListIterator).%New(BatchesPitchedLijst) - - Set BatchExportedDto = ##class(APPS.Halux.Planning.Pitching.dto.BatchPitchExported).%New() - Set BatchExportedDto.BatchId = DummyBatchId - Set BatchExportedDto.IsExported = IsExported - - Set BatchesExportedLijst = ##class(%ListOfObjects).%New() - Do BatchesExportedLijst.Insert(BatchExportedDto) - Set BatchesExported = ##class(TECH.ListIterator).%New(BatchesExportedLijst) - + #dim BatchesPitched As TECH.ListIterator = ..GeefBatchesPitchedIterator(BatchMock) Set BatchPitchedRepositoryMock = ##class(vhTest.Mock.APPS.Halux.Planning.Pitching.impl.BatchPitchedRepository).%New() Do BatchPitchedRepositoryMock.VerwachtMethodCall("ZoekAlle").ExactAantalKeer(1).DanReturn(BatchesPitched) + #dim BatchesExported As TECH.ListIterator = ..GeefBatchesExportedIterator(DummyBatchId, IsExported) Set BatchPitchExportedRepositoryMock = ##class(vhTest.Mock.APPS.Halux.Planning.Pitching.impl.BatchPitchExportedRepository).%New() Do BatchPitchExportedRepositoryMock.VerwachtMethodCall("ZoekViaBatchId", DummyBatchId).ExactAantalKeer(1).DanReturn(BatchesExported) Do BatchPitchExportedRepositoryMock.VerwachtMethodCall("Bewaar", $$$ElkeWaarde).ExactAantalKeer(1).DanDoeNiks() - Set UitvoeringInfoLijst = ##class(APPS.Halux.PPS.dto.UitvoeringInfoLijst).%New() - Set UitvoeringInfoIterator = ##class(TECH.ListIterator).%New(UitvoeringInfoLijst) Set BatchNaarObjectiveUitvoeringInfoRepositoryMock = ##class(vhTest.Mock.APPS.Halux.PPS.Activiteit.impl.common.dto.BatchNaarObjectiveUitvoeringInfoRepository).%New() - Do BatchNaarObjectiveUitvoeringInfoRepositoryMock.VerwachtMethodCall("ZoekViaBatchId", DummyBatchId).ExactAantalKeer(1).DanReturn(UitvoeringInfoIterator) + Do BatchNaarObjectiveUitvoeringInfoRepositoryMock.VerwachtMethodCall("ZoekViaBatchId", DummyBatchId).ExactAantalKeer(1).DanReturn(..GeefLegeUitvoeringInfoIterator()) Set BatchPitchDataExporter = ##class(APPS.Halux.Planning.Pitching.impl.BatchPitchDataExporter).%New(BatchPitchedRepositoryMock, BatchPitchExportedRepositoryMock, BatchNaarObjectiveUitvoeringInfoRepositoryMock) Do BatchPitchDataExporter.ExporteerBatchPitchedDataNaarObjective() @@ -124,33 +90,24 @@ #dim DummyBatchId = 12345 #dim IsReedsGestart As %Boolean = $$$True #dim IsExported As %Boolean = $$$False + #dim AantalBatchesExported As %Integer = 0 Set BatchMock = ##class(vhTest.Mock.APPS.Halux.common.Batch).%New() - Do BatchMock.VerwachtMethodCall("IsReedsGestart").ExactAantalKeer(1).DanReturn(IsReedsGestart) - Do BatchMock.VerwachtMethodCall("GeefID").ExactAantalKeer(3).DanReturn(DummyBatchId) + Do BatchMock.VerwachtMethodCall("IsReedsGestart").DanReturn(IsReedsGestart) + Do BatchMock.VerwachtMethodCall("GeefID").DanReturn(DummyBatchId) Do BatchMock.VerwachtMethodCall("GeefCategorie").ExactAantalKeer(1).DanReturn("Legrabox") - - Set DummyBatchPitchedDto = ##class(APPS.Halux.Planning.Pitching.dto.BatchPitched).%New() - Set DummyBatchPitchedDto.Batch = BatchMock - - Set BatchesPitchedLijst = ##class(%ListOfObjects).%New() - Do BatchesPitchedLijst.Insert(DummyBatchPitchedDto) - Set BatchesPitched = ##class(TECH.ListIterator).%New(BatchesPitchedLijst) - - Set BatchesExportedLijst = ##class(%ListOfObjects).%New() - Set BatchesExported = ##class(TECH.ListIterator).%New(BatchesExportedLijst) - + + #dim BatchesPitched As TECH.ListIterator = ..GeefBatchesPitchedIterator(BatchMock) Set BatchPitchedRepositoryMock = ##class(vhTest.Mock.APPS.Halux.Planning.Pitching.impl.BatchPitchedRepository).%New() Do BatchPitchedRepositoryMock.VerwachtMethodCall("ZoekAlle").ExactAantalKeer(1).DanReturn(BatchesPitched) + #dim BatchesExported As TECH.ListIterator = ..GeefBatchesExportedIterator(DummyBatchId, IsExported, AantalBatchesExported) Set BatchPitchExportedRepositoryMock = ##class(vhTest.Mock.APPS.Halux.Planning.Pitching.impl.BatchPitchExportedRepository).%New() Do BatchPitchExportedRepositoryMock.VerwachtMethodCall("ZoekViaBatchId", DummyBatchId).ExactAantalKeer(1).DanReturn(BatchesExported) Do BatchPitchExportedRepositoryMock.VerwachtMethodCall("Bewaar", $$$ElkeWaarde).ExactAantalKeer(1).DanDoeNiks() - Set UitvoeringInfoLijst = ##class(APPS.Halux.PPS.dto.UitvoeringInfoLijst).%New() - Set UitvoeringInfoIterator = ##class(TECH.ListIterator).%New(UitvoeringInfoLijst) Set BatchNaarObjectiveUitvoeringInfoRepositoryMock = ##class(vhTest.Mock.APPS.Halux.PPS.Activiteit.impl.common.dto.BatchNaarObjectiveUitvoeringInfoRepository).%New() - Do BatchNaarObjectiveUitvoeringInfoRepositoryMock.VerwachtMethodCall("ZoekViaBatchId", DummyBatchId).ExactAantalKeer(1).DanReturn(UitvoeringInfoIterator) + Do BatchNaarObjectiveUitvoeringInfoRepositoryMock.VerwachtMethodCall("ZoekViaBatchId", DummyBatchId).ExactAantalKeer(1).DanReturn(..GeefLegeUitvoeringInfoIterator()) Set BatchPitchDataExporter = ##class(APPS.Halux.Planning.Pitching.impl.BatchPitchDataExporter).%New(BatchPitchedRepositoryMock, BatchPitchExportedRepositoryMock, BatchNaarObjectiveUitvoeringInfoRepositoryMock) Do BatchPitchDataExporter.ExporteerBatchPitchedDataNaarObjective() @@ -167,34 +124,18 @@ #dim DummyBatchId = 12345 #dim IsReedsGestart As %Boolean = $$$True #dim IsExported As %Boolean = $$$False + #dim AantalBatchesExported As %Integer = 2 Set BatchMock = ##class(vhTest.Mock.APPS.Halux.common.Batch).%New() - Do BatchMock.VerwachtMethodCall("IsReedsGestart").ExactAantalKeer(1).DanReturn(IsReedsGestart) - Do BatchMock.VerwachtMethodCall("GeefID").ExactAantalKeer(1).DanReturn(DummyBatchId) + Do BatchMock.VerwachtMethodCall("IsReedsGestart").DanReturn(IsReedsGestart) + Do BatchMock.VerwachtMethodCall("GeefID").DanReturn(DummyBatchId) Do BatchMock.VerwachtMethodCall("GeefCategorie").ExactAantalKeer(0) - - Set DummyBatchPitchedDto = ##class(APPS.Halux.Planning.Pitching.dto.BatchPitched).%New() - Set DummyBatchPitchedDto.Batch = BatchMock - - Set BatchesPitchedLijst = ##class(%ListOfObjects).%New() - Do BatchesPitchedLijst.Insert(DummyBatchPitchedDto) - Set BatchesPitched = ##class(TECH.ListIterator).%New(BatchesPitchedLijst) - - Set BatchExportedDto1 = ##class(APPS.Halux.Planning.Pitching.dto.BatchPitchExported).%New() - Set BatchExportedDto1.BatchId = DummyBatchId - Set BatchExportedDto1.IsExported = IsExported - Set BatchExportedDto2 = ##class(APPS.Halux.Planning.Pitching.dto.BatchPitchExported).%New() - Set BatchExportedDto2.BatchId = DummyBatchId - Set BatchExportedDto2.IsExported = IsExported - - Set BatchesExportedLijst = ##class(%ListOfObjects).%New() - Do BatchesExportedLijst.Insert(BatchExportedDto1) - Do BatchesExportedLijst.Insert(BatchExportedDto2) - Set BatchesExported = ##class(TECH.ListIterator).%New(BatchesExportedLijst) - + + #dim BatchesPitched As TECH.ListIterator = ..GeefBatchesPitchedIterator(BatchMock) Set BatchPitchedRepositoryMock = ##class(vhTest.Mock.APPS.Halux.Planning.Pitching.impl.BatchPitchedRepository).%New() Do BatchPitchedRepositoryMock.VerwachtMethodCall("ZoekAlle").ExactAantalKeer(1).DanReturn(BatchesPitched) + #dim BatchesExported As TECH.ListIterator = ..GeefBatchesExportedIterator(DummyBatchId, IsExported, AantalBatchesExported) Set BatchPitchExportRepositoryMock = ##class(vhTest.Mock.APPS.Halux.Planning.Pitching.impl.BatchPitchExportedRepository).%New() Do BatchPitchExportRepositoryMock.VerwachtMethodCall("ZoekViaBatchId", DummyBatchId).ExactAantalKeer(1).DanReturn(BatchesExported) @@ -211,6 +152,49 @@ Do BatchPitchExportRepositoryMock.Verifieer() ]]> + + +BatchMock:vhTest.Mock.APPS.Halux.common.Batch +1 +TECH.Iterator + + + + +BatchId:%String,IsExported:%Boolean,Aantal:%Integer=1 +1 +TECH.Iterator + + + + +1 +TECH.Iterator + +