9using System.Collections.Generic;
12using Microsoft.VisualStudio.TestTools.UnitTesting;
32 _testDIContext = TestDIContextFactory.CreateDefaultContext();
35 #region Serialize then Deserialize
43 string expected =
"Testy2";
49 deserializedPOCO = SerializeThenDeserialiseNestingPOCO2(poco);
50 actual = deserializedPOCO.
GetValue();
53 Assert.AreEqual(expected, actual);
68 deserializedPOCO = SerializeThenDeserialiseNestingPOCO2(poco);
69 actual = deserializedPOCO.
GetValue();
72 Assert.IsNull(actual);
78 #region Private Helper Methods
82 var applicationContext = _testDIContext.CreateTestApplicationContext();
84 System.IO.MemoryStream serializationStream;
89 using (serializationStream =
new System.IO.MemoryStream())
91 formatter.
Serialize(serializationStream, valueToSerialize);
92 serializationStream.Seek(0, System.IO.SeekOrigin.Begin);
96 return deserializedValue;
A second class including a private nested class for which automatic serialization code is to be gener...
void SetValue(string value)
Tests of serialization of the NestingPOCO2 class
void SerializeThenDeserialize_NestingPOCO2WithValueOfTesty2_HasValueOfTesty2()
static void ClassInitialize(TestContext testContext)
void SerializeThenDeserialize_NestingPOCO2WithNullValue_HasNullValue()
Type to carry context information for DI in unit tests