示例#1
0
        public void DeepClone(DataSet originalDataset)
        {
            DataSet cloned = originalDataset.DeepClone();

            // Compare
            bool deepEquals      = DataComparer.DataSetsEqual(originalDataset, cloned);
            bool referenceEquals = originalDataset == cloned;

            Assert.That(deepEquals, Is.True);
            Assert.That(referenceEquals, Is.False);
        }
示例#2
0
        public void SerializationDeserialization(DataSet originalDataset)
        {
            // Serialize System.Data.DataSet to json string
            string jsonString = originalDataset.ToJSON();

            // --> Transfer json string using (e.g.) HTTP transport -->

            // Deserialize back to System.Data.DataSet
            DataSet restoredDataSet = jsonString.ToDataSet();

            // Compare
            bool equals = DataComparer.DataSetsEqual(originalDataset, restoredDataSet);

            Assert.That(equals, Is.True);
        }