예제 #1
0
        public void TestUnitSpecificProperty(Unit unit, String propertyName,
            Object inputValue, Object expectedOutputValue)
        {
            Console.WriteLine("\nTesting setting/getting a unit-specific property");
            unit.SetProperty(propertyName, inputValue);

            Object outputValue = unit.GetProperty(propertyName);

            if (expectedOutputValue.Equals(outputValue))
                Console.WriteLine("Test passed");
            else
                Console.WriteLine("Test failed: " + outputValue + " didn't match " + expectedOutputValue);
        }
예제 #2
0
        public void TestChangeProperty(Unit unit, String propertyName,
            Object inputValue, Object expectedOutputValue)
        {
            Console.WriteLine("\nTesting changing an existing property's value");
            unit.SetProperty(propertyName, inputValue);

            Object outputValue = unit.GetProperty(propertyName);

            if (expectedOutputValue.Equals(outputValue))
                Console.WriteLine("Test passed");
            else
                Console.WriteLine("Test failed: " + outputValue + " didn't match " + expectedOutputValue);
        }