public void Serialization_works() { // arrange: EnvironmentBase environment = CreateNewEnvironmentToTestSerialization(); ApplicationBase app = new Fakes.FakeApplication(environment, null); Application.Initialize(app); // act: Stream stream = TestUtilities.Serialize <IEnvironment>(environment); // assert: Assert.IsNotNull(stream); }
public void Deserialization_returnApplicationEnvironmentInstance() { // arrange: EnvironmentBase environment = CreateNewEnvironmentToTestSerialization(); ApplicationBase app = new Fakes.FakeApplication(environment, null); Application.Initialize(app); Stream stream = TestUtilities.Serialize <IEnvironment>(environment); // act: IEnvironment deserialized = TestUtilities.Deserialize <IEnvironment>(stream); // assert: Assert.AreSame(environment, deserialized); }