public void PrimitiveArray() { PrimitiveArrayObject to = new PrimitiveArrayObject(); IObjectWrapper wrapper = GetWrapper(to); wrapper.SetPropertyValue("Array", new String[] {"1", "2"}); Assert.AreEqual(2, to.Array.Length); Assert.AreEqual(1, to.Array[0]); Assert.AreEqual(2, to.Array[1]); }
public void PrimitiveArrayFromCommaDelimitedString() { PrimitiveArrayObject to = new PrimitiveArrayObject(); IObjectWrapper wrapper = GetWrapper(to); wrapper.SetPropertyValue("Array", "1,2"); Assert.AreEqual(2, to.Array.Length); Assert.AreEqual(1, to.Array[0]); Assert.AreEqual(2, to.Array[1]); }
public void GetIndexedPropertyValueWithGuffIndexFromArrayProperty() { PrimitiveArrayObject to = new PrimitiveArrayObject(); IObjectWrapper wrapper = GetWrapper(to); to.Array = new int[] {1, 2, 3, 4, 5}; Assert.Throws<InvalidPropertyException>(() => wrapper.GetPropertyValue("Array[HungerHurtsButStarvingWorks]")); }
public void GetIndexedPropertyValueWithMissingIndexFromArrayProperty() { PrimitiveArrayObject to = new PrimitiveArrayObject(); IObjectWrapper wrapper = GetWrapper(to); to.Array = new int[] {1, 2, 3, 4, 5}; Assert.Throws<InvalidPropertyException>(() => wrapper.GetPropertyValue("Array[]")); }
public void SetIndexOutOfRangeFromArrayProperty() { PrimitiveArrayObject to = new PrimitiveArrayObject(); IObjectWrapper wrapper = GetWrapper(to); to.Array = new int[] {1, 2, 3, 4, 5}; Assert.Throws<InvalidPropertyException>(() => wrapper.SetPropertyValue("Array[5]", 6)); }
public void SetIndexedFromArrayProperty() { PrimitiveArrayObject to = new PrimitiveArrayObject(); IObjectWrapper wrapper = GetWrapper(to); to.Array = new int[] {1, 2, 3, 4, 5}; wrapper.SetPropertyValue("Array[2]", 6); Assert.AreEqual(6, to.Array[2]); }
public void GetIndexedFromArrayProperty() { PrimitiveArrayObject to = new PrimitiveArrayObject(); IObjectWrapper wrapper = GetWrapper(to); to.Array = new int[] {1, 2, 3, 4, 5}; Assert.AreEqual(1, (int) wrapper.GetPropertyValue("Array[0]")); }
public void GetIndexedPropertyValueWithGuffIndexFromArrayProperty() { PrimitiveArrayObject to = new PrimitiveArrayObject(); IObjectWrapper wrapper = GetWrapper(to); to.Array = new int[] {1, 2, 3, 4, 5}; Assert.AreEqual(1, (int) wrapper.GetPropertyValue("Array[HungerHurtsButStarvingWorks]")); }
public void SetIndexOutOfRangeFromArrayProperty() { PrimitiveArrayObject to = new PrimitiveArrayObject(); IObjectWrapper wrapper = GetWrapper(to); to.Array = new int[] {1, 2, 3, 4, 5}; wrapper.SetPropertyValue("Array[5]", 6); }