public void WorkspaceDataConstructorTest() { object data = new TraceLab.Core.Test.Workspaces.TestObject(); WorkspaceUnitData target = new WorkspaceUnitData(data); Assert.AreEqual(data, target.Data); }
public void WorkspaceDataConstructorTest() { object data = new TraceLab.Core.Test.Workspaces.TestObject(); WorkspaceUnitData target = new WorkspaceUnitData(data); Assert.AreEqual(data, target.Data); }
public void InvalidXmlReaderThrows() { var data = new TraceLab.Core.Test.Workspaces.TestObject(); data.Value = "this is a test"; System.Xml.Serialization.IXmlSerializable target = new WorkspaceUnitData(data); target.ReadXml(null); }
public void SchemaIsNull() { var data = new TraceLab.Core.Test.Workspaces.TestObject(); data.Value = "this is a test"; System.Xml.Serialization.IXmlSerializable target = new WorkspaceUnitData(data); Assert.IsNull(target.GetSchema()); }
public void DataTest() { WorkspaceUnitData target = new WorkspaceUnitData(new TraceLab.Core.Test.Workspaces.TestObject()); // TODO: Initialize to an appropriate value object expected = new TraceLab.Core.Test.Workspaces.TestObject(); object actual = null; target.Data = expected; actual = target.Data; Assert.AreEqual(expected, actual); }
public void XmlSerializeTest() { var data = new TraceLab.Core.Test.Workspaces.TestObject(); data.Value = "this is a test"; WorkspaceUnitData target = new WorkspaceUnitData(data); var stream = new System.IO.MemoryStream(); var formatter = new System.Xml.Serialization.XmlSerializer(typeof(WorkspaceUnitData)); Assert.IsTrue(stream.Length == 0); formatter.Serialize(stream, target); Assert.IsTrue(stream.Length > 0); stream.Position = 0; var result = (WorkspaceUnitData)formatter.Deserialize(stream); var resultData = (TraceLab.Core.Test.Workspaces.TestObject)result.Data; Assert.AreEqual(data.Value, resultData.Value); }
public void RawBinarySerializeTest() { var data = new TraceLab.Core.Test.Workspaces.TestObject(); data.Value = "this is a test"; WorkspaceUnitData target = new WorkspaceUnitData(data); var stream = new System.IO.MemoryStream(); var writer = new System.IO.BinaryWriter(stream); Assert.IsTrue(stream.Length == 0); target.WriteData(writer); Assert.IsTrue(stream.Length > 0); stream.Position = 0; var result = (WorkspaceUnitData)Activator.CreateInstance(typeof(WorkspaceUnitData), true); result.ReadData(new System.IO.BinaryReader(stream)); var resultData = (TraceLab.Core.Test.Workspaces.TestObject)result.Data; Assert.AreEqual(data.Value, resultData.Value); }
public void InvalidXmlReaderThrows() { var data = new TraceLab.Core.Test.Workspaces.TestObject(); data.Value = "this is a test"; System.Xml.Serialization.IXmlSerializable target = new WorkspaceUnitData(data); target.ReadXml(null); }
public void SchemaIsNull() { var data = new TraceLab.Core.Test.Workspaces.TestObject(); data.Value = "this is a test"; System.Xml.Serialization.IXmlSerializable target = new WorkspaceUnitData(data); Assert.IsNull(target.GetSchema()); }
public void XmlSerializeTest() { var data = new TraceLab.Core.Test.Workspaces.TestObject(); data.Value = "this is a test"; WorkspaceUnitData target = new WorkspaceUnitData(data); var stream = new System.IO.MemoryStream(); var formatter = new System.Xml.Serialization.XmlSerializer(typeof(WorkspaceUnitData)); Assert.IsTrue(stream.Length == 0); formatter.Serialize(stream, target); Assert.IsTrue(stream.Length > 0); stream.Position = 0; var result = (WorkspaceUnitData)formatter.Deserialize(stream); var resultData = (TraceLab.Core.Test.Workspaces.TestObject)result.Data; Assert.AreEqual(data.Value, resultData.Value); }
public void RawBinarySerializeTest() { var data = new TraceLab.Core.Test.Workspaces.TestObject(); data.Value = "this is a test"; WorkspaceUnitData target = new WorkspaceUnitData(data); var stream = new System.IO.MemoryStream(); var writer = new System.IO.BinaryWriter(stream); Assert.IsTrue(stream.Length == 0); target.WriteData(writer); Assert.IsTrue(stream.Length > 0); stream.Position = 0; var result = (WorkspaceUnitData)Activator.CreateInstance(typeof(WorkspaceUnitData), true); result.ReadData(new System.IO.BinaryReader(stream)); var resultData = (TraceLab.Core.Test.Workspaces.TestObject)result.Data; Assert.AreEqual(data.Value, resultData.Value); }
public void DataTest() { WorkspaceUnitData target = new WorkspaceUnitData(new TraceLab.Core.Test.Workspaces.TestObject()); // TODO: Initialize to an appropriate value object expected = new TraceLab.Core.Test.Workspaces.TestObject(); object actual = null; target.Data = expected; actual = target.Data; Assert.AreEqual(expected, actual); }