private static void Command() { Console.WriteLine("Введите команду"); string command = Console.ReadLine(); if (openr.IsMatch(command)) { char[] c = { ' ', '.' }; handler.Path = command.Split(c, StringSplitOptions.RemoveEmptyEntries)[1]; handler.Open(); } if (changer.IsMatch(command)) { char[] c = { ' ', '.' }; handler.Path = command.Split(c, StringSplitOptions.RemoveEmptyEntries)[1]; handler.Chenge(); } if (saver.IsMatch(command)) { handler.Save(); return; } if (creater.IsMatch(command)) { char[] c = { ' ', '.' }; handler.Path = command.Split(c, StringSplitOptions.RemoveEmptyEntries)[1]; handler.Create(); } Command(); }
public void CreateTest() { _target.Create(_mockFileInfo.Name); _mockDirectory.Received().CreateDirectory(_mockFileInfo.Name); _mockDirectory.Received().GetCreationTime(_mockFileInfo.CreationTime.ToString(CultureInfo.InvariantCulture)); _mockConsole.Received().WriteLine($"The directory was created successfully at {_mockDirectory.GetCreationTime("")}."); }
public void Create() { if (strategy != null) { strategy.Create(); } }
static void Main(string[] args) { AbstractHandler abstractHandler = AbstractHandler.StartHandler("XML"); abstractHandler.Create(); abstractHandler.Open(); abstractHandler.Change(); abstractHandler.Save(); Console.ReadKey(); }