コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }