Exemple #1
0
 public NonYieldingOperationScenarioTests()
 {
     _logger  = Substitute.For <IProcessLogger>();
     _data    = new NonYieldingOperationRow[] { new NonYieldingOperationRow(), new NonYieldingOperationRow() };
     _process = new NonYieldingOperationProcess(_logger);
     _process.Execute(_data);
 }
        public SectorUpdatedEV(
            IProcessLogger logger,
            SectorRepository repository
            )
            : base(logger)
        {
            // Conditions
            repository.Requires(nameof(repository)).IsNotNull();
            this.repository = repository;

            // Validation rules

            RuleFor(x => x.TenantUniqueId)
            .NotNull()
            .NotEqual(new Guid());

            RuleFor(x => x.UserUniqueId)
            .NotNull()
            .NotEqual(new Guid());

            RuleFor(x => x.CorrelationUniqueId)
            .NotNull()
            .NotEqual(new Guid());

            RuleFor(x => x.UniqueId)
            .NotNull()
            .NotEqual(new Guid());
        }
Exemple #3
0
        public static int OutputExecution(
            ProcessStartInfo info,
            IProcessLogger logger)
        {
            info.UseShellExecute        = false;
            info.RedirectStandardOutput = true;
            info.RedirectStandardError  = true;

            var proc = Process.Start(info);

            if (proc == null)
            {
                throw new InvalidProgramException("Process.Start has generated a null process");
            }

            logger = logger ?? new NullProcessLogger();

            proc.ErrorDataReceived += (sender, e) => { if (e.Data != null)
                                                       {
                                                           logger.WriteError(e.Data);
                                                       }
            };
            proc.OutputDataReceived += (sender, e) => { if (e.Data != null)
                                                        {
                                                            logger.WriteMessage(e.Data);
                                                        }
            };

            proc.BeginErrorReadLine();
            proc.BeginOutputReadLine();

            proc.WaitForExit();
            return(proc.ExitCode);
        }
Exemple #4
0
 public ProcessRunner WithLog(IProcessLogger logger)
 {
     lock (_lock)
     {
         _loggers.Add(logger);
     }
     return(this);
 }
 public AState(List <string> data, IProcessLogger logger)
 {
     StateNo   = int.Parse(data[0]);
     StateName = data[1];
     StateCode = data[2].ToUpper();
     TaxRate   = decimal.Parse(data[3]);
     _logger   = logger;
     _logger.Log($"STATE: {StateName.ToUpper()} - {StateCode}", true);
 }
Exemple #6
0
        public Process(ProcessId id, IProcessLogger logger, IProcessSetup processSetup, IProcessExecutor processExecutor)
        {
            Guard.IsNotNull(id, nameof(ProcessId));

            Id               = id.CurrentGuid;
            _logger          = logger;
            _processSetup    = processSetup;
            _processExecutor = processExecutor;
        }
Exemple #7
0
 public AItem(List <string> data, IProcessLogger logger)
 {
     PartNo          = int.Parse(data[0]);
     PartName        = data[1];
     PartDescription = data[2];
     PartPrice       = decimal.Parse(data[3]);
     PartSale        = decimal.Parse(data[4]);
     PartImage       = data[5];
     _logger         = logger;
     _logger.Log($"STORE No.: {PartNo} - {PartName.ToUpper()}", true);
 }
Exemple #8
0
 public AStore(List <string> data, IProcessLogger logger)
 {
     StoreNo            = int.Parse(data[0]);
     StoreName          = data[1];
     StoreCity          = data[2];
     StoreStateId       = int.Parse(data[3]);
     StoreZipCode       = int.Parse(data[4]);
     StoreStreetAddress = data[5];
     _logger            = logger;
     _logger.Log($"STORE No.: {StoreNo} - {StoreName.ToUpper()}", true);
 }
 public AOrder(List <string> data, IProcessLogger logger)
 {
     OrderNo   = int.Parse(data[0]);
     StoreNo   = int.Parse(data[1]);
     AccountNo = int.Parse(data[2]);
     OrderDate = createNewDate(data[3]);
     Subtotal  = decimal.Parse(data[4]);
     Tax       = decimal.Parse(data[5]);
     Total     = decimal.Parse(data[6]);
     _logger   = logger;
     _logger.Log($"ORDER: {OrderNo} of total {Total}", true);
 }
 public AUser(List <string> data, IProcessLogger logger)
 {
     AccountNo    = int.Parse(data[0]);
     Firstname    = data[1];
     Lastname     = data[2];
     Username     = data[3];
     PasswordSalt = data[4];
     PasswordHash = data[5];
     Phone        = data[6];
     Email        = data[7];
     Permission   = int.Parse(data[8]);
     DefaultStore = int.Parse(data[9]);
     _logger      = logger;
     _logger.Log($"USER: {Firstname.ToUpper()} {Lastname.ToUpper()} with username {Username.ToUpper()}", true);
 }
Exemple #11
0
        public bool Pack(
            IProcessLogger logger = null,
            bool doOutputSymbols  = true)
        {
            var nugetPackStartInfo = new ProcessStartInfo
            {
                FileName  = "nuget.exe",
                Arguments =
                    string.Format("pack \"{0}\" {1} -build -outputDirectory \"{2}\" -properties Configuration=Release",
                                  TargetProjectFilePath,
                                  doOutputSymbols ? "-symbols" : string.Empty,
                                  Path.GetDirectoryName(TargetProjectFilePath)),
                WindowStyle = ProcessWindowStyle.Hidden
            };

            return(ProcessOutput.OutputExecution(nugetPackStartInfo, logger) == 0);
        }
Exemple #12
0
        public bool Push(
            string packagePath,
            IProcessLogger logger = null,
            string source         = null,
            string apiKey         = null)
        {
            var nugetPushStartInfo = new ProcessStartInfo
            {
                FileName  = "nuget.exe",
                Arguments = string.Format("push \"{0}\" {1} {2}",
                                          packagePath,
                                          string.IsNullOrEmpty(apiKey) ? string.Empty : apiKey,
                                          string.IsNullOrEmpty(source) ? string.Empty : string.Format("-s {0}", source)),
                WindowStyle = ProcessWindowStyle.Hidden
            };

            return(ProcessOutput.OutputExecution(nugetPushStartInfo, logger) == 0);
        }
 public ProductImportProcessContext(IProcessLogger log, IDictionary <string, dynamic> contextData)
 {
     Log      = log;
     Database = contextData["database"];
 }
 protected override CustomContext CreateProcessContext(IProcessLogger log, IDictionary <string, dynamic> data)
 {
     return(new CustomContext());
 }
 public ProcessExecutor(IProcessLogger logger, IExecutionPlanFactory executionPlanFactory)
 {
     _logger = logger;
     _executionPlanFactory = executionPlanFactory;
 }
 public YieldingOperationProcess(IProcessLogger log)
 {
     _log           = log;
     ExecutionOrder = new ProcessEventLog();
 }
 protected override ProductImportProcessContext CreateProcessContext(IProcessLogger log, IDictionary<string, dynamic> contextData)
 {
     return new ProductImportProcessContext(log, contextData);
 }
Exemple #18
0
 public IntegrationArchiver(IFileStorage fileStorage, IProcessLogger logger, IIntegrationSettings settings)
 {
     _fileStorage = fileStorage;
     _logger      = logger;
     _settings    = settings;
 }
Exemple #19
0
 protected override DefaultProcessContext CreateProcessContext(IProcessLogger log, IDictionary <string, dynamic> contextData)
 {
     return(new DefaultProcessContext(log, contextData));
 }
Exemple #20
0
 public IAStore CreateStore(List <string> data, IProcessLogger logger)
 {
     return(new AStore(data, logger));
 }
Exemple #21
0
 public DefaultProcessContext(IProcessLogger log, IDictionary <string, dynamic> data)
 {
     Data = data ?? new Dictionary <string, object>();
     Log  = log;
 }
Exemple #22
0
 public IAOrder CreateOrder(List <string> data, IProcessLogger logger)
 {
     return(new AOrder(data, logger));
 }
Exemple #23
0
 public IAItem CreateItem(List <string> data, IProcessLogger logger)
 {
     return(new AItem(data, logger));
 }