Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }