private static void AddDataStringToArchive(IMS2Archive archive, string data, string dataForArchiving, Mock <IMS2SizeHeader> sizeMock, uint id, string name, CompressionType compressionType)
        {
            byte[] bytes = EncodingTest.GetBytes(data);
            var    ms    = new MemoryStream(bytes);

            byte[] bytesArchiving = EncodingTest.GetBytes(dataForArchiving);
            var    msArchiving    = new MemoryStream(bytesArchiving);

            var fileMock = CreateFileMock(archive, ms, msArchiving, sizeMock, id, name, compressionType);

            archive.Add(fileMock.Object);
        }
Exemple #2
0
        private static List <Mock <IMS2File> > AddFileMocksToArchive(IMS2Archive archive, int fileCount)
        {
            var mocks = new List <Mock <IMS2File> >();

            for (int i = 0; i < fileCount; i++)
            {
                var fileMock = new Mock <IMS2File>(MockBehavior.Strict);
                fileMock.SetupGet(f => f.Id).Returns(i);
                fileMock.Setup(f => f.Dispose()).Verifiable();
                archive.Add(fileMock.Object);
                mocks.Add(fileMock);
            }

            return(mocks);
        }