示例#1
0
 protected void WriteZip <T>(string zip, params T[] ts)
 {
     Assert.IsTrue(zip.StartsWith(DirTestRoot));
     EnsureParentExists(zip);
     using (var wa = new WritingArchive(zip))
     {
         wa.AddAll(ts);
     }
 }
示例#2
0
        private void Write(params IDEEvent[] es)
        {
            var fullName = Path.Combine(_dirEvents, "x.zip");

            using (var wa = new WritingArchive(fullName))
            {
                wa.AddAll(es);
            }
        }
示例#3
0
        private void WriteResults(IEnumerable <IDEEvent> events, string relZip)
        {
            _log.WritingEvents();
            var zip = _io.GetFullPath_Out(relZip);

            _io.EnsureParentExists(zip);
            using (var wa = new WritingArchive(zip))
            {
                wa.AddAll(events);
            }
        }
        private void Add(string relFile, params IDEEvent[] events)
        {
            var file   = Path.Combine(RawDir, relFile);
            var parent = Path.GetDirectoryName(file);

            // ReSharper disable once AssignNullToNotNullAttribute
            Directory.CreateDirectory(parent);
            using (var wa = new WritingArchive(file))
            {
                wa.AddAll(events);
            }
        }
        public void WriteAll()
        {
            var expected = new[] { "a", "b", "c" };

            using (var sut = new WritingArchive(_zipPath))
            {
                sut.AddAll(expected);
            }
            var actual = ReadZip();

            Assert.AreEqual(expected, actual);
        }