public void ResolveType_ArrayIsNull_ReturnsArrayElementType() { var data = new { Amounts = null as int[] }; var property = new ArrayItemProperty("Amounts", 2); var type = property.ResolveType(data.GetType()); Assert.AreEqual(typeof(int), type); }
public void ResolveType_PropertyDoesNotExist_ThrowsInvalidOperationException() { var data = new { Amounts = new [] { 4126 } }; var property = new ArrayItemProperty("stnuoma", 0); Assert.Throws <InvalidOperationException>(() => { property.ResolveType(data.GetType()); }); }
public void ResolveType_ArrayItem_ReturnsArrayElementType() { var data = new { Amounts = new[] { 4126, 309, 9281 } }; var property = new ArrayItemProperty("Amounts", 2); var type = property.ResolveType(data.GetType()); Assert.AreEqual(typeof(int), type); }