Ejemplo n.º 1
0
        public void LastRead()
        {
            using (var wa = new WritingArchive(_zipPath))
            {
                wa.AddAsPlainText("x");
                wa.AddAsPlainText("y");
                wa.AddAsPlainText("z");
            }

            using (var ra = new ReadingArchive(_zipPath))
            {
                Assert.Null(ra.CurrentInternalFileName);
                ra.GetNextAsPlainText();
                Assert.AreEqual("0.json", ra.CurrentInternalFileName);
                ra.GetNextAsPlainText();
                Assert.AreEqual("1.json", ra.CurrentInternalFileName);
                ra.GetNextAsPlainText();
                Assert.AreEqual("2.json", ra.CurrentInternalFileName);
            }
        }
Ejemplo n.º 2
0
        public void ReadAsPlainText()
        {
            using (var wa = new WritingArchive(_zipPath))
            {
                wa.AddAsPlainText("x");
                wa.AddAsPlainText("y");
                wa.AddAsPlainText("z");
            }

            var actuals = new List <string>();

            using (var ra = new ReadingArchive(_zipPath))
            {
                while (ra.HasNext())
                {
                    actuals.Add(ra.GetNextAsPlainText());
                }
            }

            var expecteds = new[] { "x", "y", "z" };

            CollectionAssert.AreEqual(expecteds, actuals);
        }