public void TestExceptionSerialization() { ShardLocation sl1 = new ShardLocation("dataSource1", "database1"); ShardLocation sl2 = new ShardLocation("dataSource2", "database2"); MultiShardException innerEx1 = new MultiShardException(sl1); MultiShardException innerEx2 = new MultiShardException(sl2); List <Exception> exList = new List <Exception>(); exList.Add(innerEx1); exList.Add(innerEx2); MultiShardAggregateException aggEx = new MultiShardAggregateException(exList); MultiShardException deserialized1 = CommonTestUtils.SerializeDeserialize(innerEx1); CompareForEquality(innerEx1, deserialized1); MultiShardException deserialized2 = CommonTestUtils.SerializeDeserialize(innerEx2); CompareForEquality(innerEx2, deserialized2); MultiShardAggregateException deserialized3 = CommonTestUtils.SerializeDeserialize(aggEx); CompareForEquality(aggEx, deserialized3); }
public void TestExceptionSerialization() { ShardLocation sl1 = new ShardLocation("dataSource1", "database1"); ShardLocation sl2 = new ShardLocation("dataSource2", "database2"); MultiShardException innerEx1 = new MultiShardException(sl1); MultiShardException innerEx2 = new MultiShardException(sl2); List <Exception> exList = new List <Exception>(); exList.Add(innerEx1); exList.Add(innerEx2); MultiShardAggregateException aggEx = new MultiShardAggregateException(exList); TestSerialization <MultiShardException>(innerEx1); TestSerialization <MultiShardException>(innerEx2); TestSerialization <MultiShardAggregateException>(aggEx); }
private void DoExceptionComparison(MultiShardException first, MultiShardException second) { Assert.AreEqual(first.ShardLocation.Database, first.ShardLocation.Database); Assert.AreEqual(second.ShardLocation.DataSource, second.ShardLocation.DataSource); }