You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public partial class @Test.ClassName
{
@Tag("Exception")
@TestAttribute
public void @(Test.ClassName + "_Exception_Serializer")()
{
var objectUnderTest = CreateObject();
var formatter = new BinaryFormatter();
var stream = new MemoryStream();
formatter.Serialize(stream, objectUnderTest);
stream.Seek(0, SeekOrigin.Begin);
var newObject = (@Class.FullName)formatter.Deserialize(stream);
Assert.AreEqual(objectUnderTest.Message, newObject.Message, "Message is incorrect.");
}
public partial class @Test.ClassName
{
@Tag("Exception")
@TestAttribute
public void @(Test.ClassName + "_Exception_DataContractSerializer")()
{
var objectUnderTest = CreateObject();
var stream = new MemoryStream();
var serializer = new DataContractSerializer(typeof(@Class.FullName));
serializer.WriteObject(stream, objectUnderTest);
stream.Seek(0, SeekOrigin.Begin);
var result = (@Class.FullName)serializer.ReadObject(stream);
Assert.AreEqual(objectUnderTest.Message, newObject.Message, "Message is incorrect.");
}
}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: