예제 #1
0
        internal void GetFileAfterClone()
        {
            var nameOfNewFile = Config.newFileName;
            var header        = Read(Config.headerFile);
            var body          = Read(Config.bodyFile);
            var footer        = Read(Config.footerFile);

            writer.Write(nameOfNewFile, header);
            cloner.Write(nameOfNewFile, body);
            writer.Write(nameOfNewFile, footer);
        }
예제 #2
0
        internal void GetFilesWithPartsOfXml(string neededNode, string pathToXml, string typeDoc)
        {
            var path      = Path.GetFullPath(pathToXml);
            var startNode = GetLineNumberForNeededElement(neededNode, path);
            var endNode   = GetLineNumberForNeededElement(neededNode, path, false);
            var endFIle   = GetLineNumberForNeededElement(typeDoc, path, false);

            ReadAndParsXml(path, startNode, endNode, endFIle, out var header, out var body, out var footer);

            writer.Write(Config.headerFile, header);
            writer.Write(Config.bodyFile, body);
            writer.Write(Config.footerFile, footer);
        }
예제 #3
0
 private void FillWriter(ref AbstractWriter writer, DateTime startedAt, DateTime endedAt)
 {
     writer.SetCompletedTasks(Requests).
     SetEndedAtTime(endedAt)
     .SetStartedAtTime(startedAt)
     .SetStopReason(src.Entities.StopSignal.Manual);
     writer.Write();
 }
예제 #4
0
        public void Run(RunTestDto dto)
        {
            Validate(dto);
            if (HaveValidationErrors())
            {
                PrintValidationErrors();
                return;
            }

            Executor.SetConfig(dto.GetTestConfig());
            Executor.Configurate();
            Task session = Task.Run(() =>
            {
                Executor.StartTest();
            });
            bool manualyStopped = false;

            while (!session.IsCompleted)
            {
                ConsoleKeyInfo key = Console.ReadKey();
                if (key.KeyChar == STOP)
                {
                    Executor.StopExecution();
                    manualyStopped = true;
                    break;
                }
            }
            List <RequestTask> result = Executor.GetResult();

            if (result.Count == 0)
            {
                return;
            }
            AbstractWriter writer = WritersFactory.GetWriter(dto.ResultWriter);

            writer.SetCompletedTasks(result)
            .SetStartedAtTime(Executor.GetStartedAt())
            .SetEndedAtTime(DateTime.Now)
            .SetStopReason(manualyStopped ? StopSignal.Manual : dto.StopSignal);
            writer.Write();
        }