コード例 #1
0
        public void LoadFromStream()
        {
            using var memoryStream = new MemoryStream();
            _mlSample.Dump(memoryStream);
            memoryStream.Seek(0, SeekOrigin.Begin);
            var mlTest = new MemoryList(1, memoryStream);

            Assert.AreEqual(_mlSample.Modified, mlTest.Modified);
            Assert.AreEqual(_mlSample.Locked, mlTest.Locked);

            for (var i = 0; i < MemoryList.Length; i++)
            {
                Assert.AreEqual(_mlSample[i], mlTest[i]);
            }
        }
コード例 #2
0
 public void WriteToStream()
 {
     using var memoryStream = new MemoryStream();
     _mlEmpty.Dump(memoryStream);
     Assert.NotZero(memoryStream.Length);
 }