[Test]// needs dynamic handling of list itself public void TestBaseClassArrayContainerClass() { var model = CreateModel(); var container = new BaseClassArrayContainerClass(); container.BaseArray = this.CreateArray(); var cloned = (BaseClassArrayContainerClass)model.DeepClone(container); Expect(cloned.BaseArray, Is.Not.Null); foreach (var obj in cloned.BaseArray) { Expect(obj as Base, Is.Not.Null); } Expect(cloned.BaseArray[1] as Derived, Is.Not.Null); Expect(cloned.BaseArray.GetType(), Is.EqualTo(typeof(Base[])), "array type"); }
[Test]// needs dynamic handling of list itself public void TestBaseClassArrayContainerClass() { var model = CreateModel(); var container = new BaseClassArrayContainerClass(); container.BaseArray = this.CreateArray(); var cloned = (BaseClassArrayContainerClass)model.DeepClone(container); Expect(cloned.BaseArray, Is.Not.Null); foreach (var obj in cloned.BaseArray) { Expect(obj as Base, Is.Not.Null); } Expect(cloned.BaseArray[1] as Derived, Is.Not.Null); Expect(cloned.BaseArray.GetType(), Is.EqualTo(typeof(Base[])), "array type"); }
[Test]// needs dynamic handling of list itself public void TestBaseClassArrayContainerClass() { Program.ExpectFailure <InvalidOperationException>(() => { var model = CreateModel(); var container = new BaseClassArrayContainerClass(); container.BaseArray = this.CreateArray(); var cloned = (BaseClassArrayContainerClass)model.DeepClone(container); Assert.IsNotNull(cloned.BaseArray); foreach (var obj in cloned.BaseArray) { Assert.IsNotNull(obj as Base); } Assert.IsNotNull(cloned.BaseArray[1] as Derived); // this would be nice... Assert.AreEqual(typeof(Base[]), cloned.BaseArray.GetType(), "array type"); }, "Conflicting item/add type"); }
[Fact]// needs dynamic handling of list itself public void TestBaseClassArrayContainerClass() { Program.ExpectFailure <InvalidOperationException>(() => { var model = CreateModel(); model.AutoCompile = true; var container = new BaseClassArrayContainerClass(); container.BaseArray = this.CreateArray(); var cloned = (BaseClassArrayContainerClass)model.DeepClone(container); Assert.NotNull(cloned.BaseArray); foreach (var obj in cloned.BaseArray) { Assert.NotNull(obj as Base); } Assert.NotNull(cloned.BaseArray[1] as Derived); // this would be nice... Assert.Equal(typeof(Base[]), cloned.BaseArray.GetType()); //, "array type"); }, "Unable to wrap BaseClassArrayContainerClass/BaseClassArrayContainerClass: Unable to bind deserializer: Conflicting item/add type"); }
[Test]// needs dynamic handling of list itself public void TestBaseClassArrayContainerClass() { Program.ExpectFailure<InvalidOperationException>(() => { var model = CreateModel(); var container = new BaseClassArrayContainerClass(); container.BaseArray = this.CreateArray(); var cloned = (BaseClassArrayContainerClass)model.DeepClone(container); Assert.IsNotNull(cloned.BaseArray); foreach (var obj in cloned.BaseArray) { Assert.IsNotNull(obj as Base); } Assert.IsNotNull(cloned.BaseArray[1] as Derived); // this would be nice... Assert.AreEqual(typeof(Base[]), cloned.BaseArray.GetType(), "array type"); }, "Conflicting item/add type"); }