コード例 #1
0
		public void GetIndexedPropertyValueWithMissingIndexFromSetProperty()
		{
			SetTestObject to = new SetTestObject();
			IObjectWrapper wrapper = GetWrapper(to);
			to.Set = new ListSet(new int[] {1, 2, 3, 4, 5});
            Assert.Throws<InvalidPropertyException>(() => wrapper.GetPropertyValue("Set[]"));
		}
コード例 #2
0
		public void GetIndexedPropertyValueWithGuffIndexFromSetProperty()
		{
			SetTestObject to = new SetTestObject();
			IObjectWrapper wrapper = GetWrapper(to);
			to.Set = new ListSet(new int[] {1, 2, 3, 4, 5});
			Assert.AreEqual(1, (int) wrapper.GetPropertyValue("Set[HungerHurtsButStarvingWorks]"));
		}
コード例 #3
0
		public void GetIndexedPropertyValueWithMissingIndexFromSetProperty()
		{
			SetTestObject to = new SetTestObject();
			IObjectWrapper wrapper = GetWrapper(to);
			to.Set = new ListSet(new int[] {1, 2, 3, 4, 5});
            object o = wrapper.GetPropertyValue("Set[]");
			Assert.AreEqual(1, (int) wrapper.GetPropertyValue("Set[]"));
		}
コード例 #4
0
		public void GetIndexOutofRangeFromSetProperty()
		{
			SetTestObject to = new SetTestObject();
			IObjectWrapper wrapper = GetWrapper(to);
			to.Set = new ListSet(new int[] {1, 2, 3, 4, 5});
			Assert.AreEqual(1, (int) wrapper.GetPropertyValue("Set[23]"));
		}