public void TestAutoOwnershipModel() { Global.Configuration = new Configuration { NProcessors = 1 }; ParallelUtility.Init(); Global.Configuration.AutoOwnershipModelCoefficients = "c:\\a.txt"; ParallelUtility.Register(Thread.CurrentThread.ManagedThreadId, 0); List <IPerson> persons = new List <IPerson> { new Person() }; CondensedParcel residenceParcel = new CondensedParcel(); HouseholdWrapper household = TestHelper.GetHouseholdWrapper(persons, residenceParcel: residenceParcel); household.Init(); AutoOwnershipModel model = new AutoOwnershipModel(); model.RunInitialize(new TestCoefficientsReader()); model.Run(household); }
public void TestAutoOwnershipModelNullHouseholdException() { Global.Configuration = new Configuration { NProcessors = 1 }; ParallelUtility.Init(); Global.Configuration.AutoOwnershipModelCoefficients = "c:\\a.txt"; ParallelUtility.Register(Thread.CurrentThread.ManagedThreadId, 0); List <IPerson> persons = new List <IPerson> { new Person() }; CondensedParcel residenceParcel = new CondensedParcel(); HouseholdWrapper household = TestHelper.GetHouseholdWrapper(persons, residenceParcel: residenceParcel); household.Init(); AutoOwnershipModel model = new AutoOwnershipModel(); model.RunInitialize(new TestCoefficientsReader()); ArgumentNullException ex = Assert.Throws <ArgumentNullException>(() => model.Run(null)); Assert.Equal("Value cannot be null.\r\nParameter name: household", ex.Message); }