コード例 #1
0
 public void AttributeMetatadaCollection_Serialization()
 {
     // TODO: Split into more tests.
     var collection1 = new AttributeMetadataCollection();
     Assert.AreEqual(collection1.Count, 0);
     collection1.Update(123, Guid.NewGuid(), DateTime.Now, 100);
     collection1.Update(321, Guid.NewGuid(), DateTime.Now, 200);
     Assert.AreEqual(collection1.Count, 2);
     byte[] buffer1 = collection1.ToByteArray();
     int size1 = buffer1.Length;
     var collection2 = new AttributeMetadataCollection(buffer1);
     Assert.AreEqual(collection1.Count, collection2.Count);
     Assert.AreEqual(collection1.ToString(), collection2.ToString());
 }
コード例 #2
0
 public void ReadAttribute(string name, out AttributeMetadataCollection value)
 {
     byte[] binaryValue;
     this.ReadAttribute(name, out binaryValue);
     value = new AttributeMetadataCollection(binaryValue);
 }