public void Increase_SystemDateTime_Test() { SystemDateTime.CreateInstance(); int currentHour = SystemDateTime.Current.Hour; SystemDateTime.AddHours(2); Assert.Equal(SystemDateTime.Current.Hour, currentHour + 2); }
public async Task <List <CommandProcessResult> > ProcessFile(string fileName) { try { SystemDateTime.CreateInstance(); List <string> commands = await ReadFile(fileName); var results = new List <CommandProcessResult>(); foreach (string item in commands) { var resultItem = new CommandProcessResult { InputCommand = item }; string[] splittedArray = item.Split(' '); string commandText = splittedArray[0].Replace("_", ""); Enum.TryParse(commandText, true, out CommandType command); switch (command) { case CommandType.Undefined: break; case CommandType.CreateProduct: resultItem.Output = CreateProductCommand(splittedArray); break; case CommandType.CreateOrder: resultItem.Output = CreateOrderCommand(splittedArray); break; case CommandType.CreateCampaign: resultItem.Output = CreateCampaignCommand(splittedArray); break; case CommandType.GetProductInfo: resultItem.Output = GetProductInfoCommand(splittedArray); break; case CommandType.IncreaseTime: resultItem.Output = IncreaseTimeCommand(splittedArray); break; case CommandType.GetCampaignInfo: resultItem.Output = GetCampaignInfoCommand(splittedArray); break; default: break; } results.Add(resultItem); } return(results); } catch (Exception ex) { return(null); } }