Пример #1
0
        public void AddFile_0()
        {
            var src = new StringSource(null, null);

            src.AddFile("APATH", "12345");

            var stream = src.GetReport("APATH");

            Assert.AreEqual("12345", StreamToString(stream));
        }
Пример #2
0
        public void Catcher_Report_1()
        {
            var src = new StringSource($"F1", "{\"ReportPath\":\"APATH.PDF\"}");

            src.AddFile("APATH.PDF", "12345");

            var hnd   = new MemoryHandledStorage();
            var saver = new StringSaver();
            var f     = new MemoryFileStorage();

            var catcher = new Catcher(src, hnd, saver, f);

            catcher.Go();

            Assert.AreEqual("12345", f.Dict["APATH.PDF"]);
        }
Пример #3
0
        public void Catcher_Report_2()
        {
            var APATH = "APATH";

            var src = new StringSource($"F1", "{\"ReportPath\":\"" + APATH + "\"}");

            src.AddFile(APATH, "12345");

            var hnd   = new MemoryHandledStorage();
            var saver = new StringSaver();
            var f     = new MemoryFileStorage();

            var catcher = new Catcher(src, hnd, saver, f);

            catcher.Go();



            Assert.IsFalse(f.Dict.Keys.Contains(APATH));
        }
Пример #4
0
        public void Catcher_Report_3()
        {
            var APATH = "APATH.PDF";

            var src = new StringSource($"F1", "{\"ReportPath\":\"" + APATH + "\"}");

            src.AddFile(APATH, "FILE_CONTENT_HERE");

            var hnd   = new MemoryHandledStorage();
            var saver = new StringSaver();
            var f     = new MemoryFileStorage();

            var catcher = new Catcher(src, hnd, saver, f);

            catcher.Go();

            var url = APATH;

            Assert.IsNotNull(saver.DTO.ReportURL);
            Assert.AreEqual(url, saver.DTO.ReportURL);
        }