public void ClassWithCollectionSerializes() { var col = new ClassWithCollections { Id = 2, ProductVariants = new List<SimpleClass> { new SimpleClass {Id = 1, Name = "class 1"}, new SimpleClass {Id = 1, Name = "class 1"}, } }; var json = this._client.Serializer.Serialize(col); this.JsonEquals(json, MethodInfo.GetCurrentMethod()); }
public void ManagedObjectClone_ClassWithCollections() { var src = new ClassWithCollections { IntList = new List <int> { 1, 5, 9 } }; var dst = new ManagedObjectClone().Clone(src) as ClassWithCollections; Assert.That(dst, Is.Not.Null); Assert.That(dst, Is.Not.SameAs(src)); Assert.That(dst.IntList, Is.Not.SameAs(src.IntList)); Assert.That(dst.IntList.Count, Is.EqualTo(src.IntList.Count)); Assert.That(dst.IntList, Is.EquivalentTo(src.IntList)); }
public void ClassWithCollectionSerializes() { var col = new ClassWithCollections { Id = 2, ProductVariants = new List <SimpleClass> { new SimpleClass { Id = 1, Name = "class 1" }, new SimpleClass { Id = 1, Name = "class 1" }, } }; var json = this._client.Serializer.Serialize(col); this.JsonEquals(json, MethodInfo.GetCurrentMethod()); }
public override void SetValue(ref ClassWithCollections container, Dictionary <HashSet <List <float> >, List <List <string> > > value) { container.Complex = value; }
public override Dictionary <HashSet <List <float> >, List <List <string> > > GetValue(ref ClassWithCollections container) { return(container.Complex); }
public override void SetValue(ref ClassWithCollections container, List <int> value) { container.Int32List = value; }
public override List <int> GetValue(ref ClassWithCollections container) { return(container.Int32List); }