9using System.Collections.Generic;
12using Microsoft.VisualStudio.TestTools.UnitTesting;
32 _testDIContext = TestDIContextFactory.CreateDefaultContext();
35 #region Serialize then Deserialize
43 string expected =
"Testy";
49 deserializedPOCO = SerializeThenDeserialiseNestingPOCO(poco);
50 actual = deserializedPOCO.
GetValue();
53 Assert.AreEqual(expected, actual);
68 deserializedPOCO = SerializeThenDeserialiseNestingPOCO(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 class including a private nested class for which automatic serialization code is to be generated
void SetValue(string value)
Tests of serialization of the NestingPOCO class
void SerializeThenDeserialize_NestingPOCOWithValueOfTesty_HasValueOfTesty()
static void ClassInitialize(TestContext testContext)
void SerializeThenDeserialize_NestingPOCOWithNullValue_HasNullValue()
Type to carry context information for DI in unit tests