Esempio n. 1
0
 public void AssertCorrectContents_correctly_identifies_ToStream_result()
 {
     TestObjClassSerializationMock.ToStream <LocalMock, TestEnum>(sw, iftFactory);
     ms.Seek(0, SeekOrigin.Begin);
     TestObjClassSerializationMock.AssertCorrectContents <LocalMock, TestEnum>(sr, iftFactory);
     Assert.That(ms.Position, Is.EqualTo(ms.Length), "AssertCorrectContents didn't read complete stream");
 }
Esempio n. 2
0
        public void ToStream_creates_correct_Stream()
        {
            var typeMap = scope.Resolve <TypeMap>();
            var ms      = new MemoryStream();
            var sw      = new ZetboxStreamWriter(typeMap, new BinaryWriter(ms));
            var sr      = new ZetboxStreamReader(typeMap, new BinaryReader(ms));

            InitialiseObject(obj);
            obj.ToStream(sw, null, false);

            Assert.That(ms.Length, Is.GreaterThan(0));
            ms.Seek(0, SeekOrigin.Begin);

            TestObjClassSerializationMock.AssertCorrectContents <TestObjClass, TestEnum>(sr, _iftFactory);
        }