Hi all,
I've got a question about setting up unit tests for business objects that depend on certain other objects having done their job.
Basically, I've got a JobSchedules BO that I want to test to make sure it's loading up upcoming jobs that need to be manufactured, but in order for a job to be ready for manufacture, there's about half a dozen steps that need to be performed for each job. What's the best way to do this kind of thing? I'm heading down the route of just calling all the business objects in order to set up the job correctly, but I'm a bit worried that if there's a problem with an unrelated BO, this test will fail (ie, if the Materials BO fails, the job may never get ordered, which means it doesn't show up to be scheduled, which means if I test to make sure it's showing up in the Scheduler BO, that test will fail as well, without any clear indication of why). Worst case would be like a top end BO failing (no Job at all!) and like 100 tests go red.
On the other hand, I wouldn't want to script it out either, because I need to know that all appropriate business logic has been applied at all stages. I'm still new to this Test Driven type stuff, so maybe I'm just missing something simple?
I've got a question about setting up unit tests for business objects that depend on certain other objects having done their job.
Basically, I've got a JobSchedules BO that I want to test to make sure it's loading up upcoming jobs that need to be manufactured, but in order for a job to be ready for manufacture, there's about half a dozen steps that need to be performed for each job. What's the best way to do this kind of thing? I'm heading down the route of just calling all the business objects in order to set up the job correctly, but I'm a bit worried that if there's a problem with an unrelated BO, this test will fail (ie, if the Materials BO fails, the job may never get ordered, which means it doesn't show up to be scheduled, which means if I test to make sure it's showing up in the Scheduler BO, that test will fail as well, without any clear indication of why). Worst case would be like a top end BO failing (no Job at all!) and like 100 tests go red.
On the other hand, I wouldn't want to script it out either, because I need to know that all appropriate business logic has been applied at all stages. I'm still new to this Test Driven type stuff, so maybe I'm just missing something simple?