do ##class(vhUnitTest.Manager).RunTest("/debug/display=all","APPS.Halux.common.TestBatchService") 1 vhUnitTest.TestCase 0,"Er is een batch id verkregen : "_Batch.GeefID()) Do $$$AssertEquals(Batch.GeefProductieGroep(),##class(APPS.Halux.common.enu.ProductieGroep).Stuk(),"De productiegroep") #dim BatchID As %String = Batch.GeefID() Set Batch = "" Try { Set Batch = ##class(vhUnitTest.APPS.Halux.BatchUtils).GeefNieuweBatch(Toeleveringen,##class(APPS.Halux.common.enu.ProductieLijn).Een()) Do $$$AssertTrue(0,"De batch werd wel succesvol gemaakt, dit mag niet gebeuren") } Catch { #dim Exceptie As APPS.Halux.common.impl.MaakBatchException = ##class(TECH.ExceptionHandler).Catch() Do $$$AssertTrue($IsObject(Exceptie),"Een exceptie werd aangemaakt") If $$$AssertEquals(Exceptie.%ClassName(),"MaakBatchException","De exceptie is van het type "_Exceptie.%ClassName()) { Do $$$AssertContains(Exceptie.BatchErrors.GetAt(1).Boodschappen.GetAt(1),"Deze toelevering zit reeds in batch") } } Do BatchService.VerwijderBatch(BatchID) Do $$$AssertFalse(BatchService.BestaatBatch(BatchID)) ]]>