public void Trim_trailing_whitespace() { const string text = "Deadpool "; var actual = _cleaner.Clean(text); Assert.That(actual, Is.EqualTo(new [] { "Deadpool" })); }
private bool ReadCommand(out int commandNumber) { writer.Write(this.menu.Show()); bool result = int.TryParse(this.reader.ReadLine(), out commandNumber); cleaner.Clean(); return(result); }
private void StartClicked(object sender, EventArgs e) { DirectoryInfo directoryInfo = new DirectoryInfo(path.Text); string caption = "Please confirm"; string text = "All empty folders will be deleted from" + Environment.NewLine + Environment.NewLine + directoryInfo.FullName; DialogResult dialogResult = MessageBox.Show(this, text, caption, MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk); if (dialogResult == DialogResult.OK) { Running = true; cleaner.Clean(directoryInfo); } }
public string Clean(string value) { if (_sub != null) { value = _sub.Clean(value); } if (_generic.Equals(value)) { return(null); } return(value); }
public string[] Generate() { var words = new List <string>(); using (var bufferedStream = new BufferedStream(_stream)) using (var streamReader = new StreamReader(bufferedStream)) { string line; while ((line = streamReader.ReadLine()) != null) { var cleaned = _cleaner.Clean(line); words.AddRange(cleaned); } } return(words.ToArray()); }
private void StartClicked(object sender, EventArgs e) { var directory = new DirectoryInfo(path.Text); var caption = "Please confirm"; var message = "All empty folders will be deleted from" + Environment.NewLine + Environment.NewLine + directory.FullName; var result = MessageBox.Show(this, message, caption, MessageBoxButtons.OKCancel, MessageBoxIcon.Information); if (result == DialogResult.OK) { Running = true; cleaner.Clean(directory); } }
/// <param name="maxCount">Максимальне число объектов, которые может создать пул.</param> public ObjectPool(ICreator <T> creator, ICleaner <T> cleaner = null, int maxCount = Int32.MaxValue) : this(() => creator.Create(), obj => cleaner.Clean(obj), maxCount) { }
public SizeDefiningObjectPoolProvider(int sizeOfElement, ICreator <T> creator, ICleaner <T> cleaner = null) : this(sizeOfElement, () => creator.Create(), obj => cleaner.Clean(obj)) { }
public void DoWork() { Console.WriteLine("Doing Carpentry"); _clean.Clean(); }
public void Clean(ICleaner sanitizer, CreatureList.Creature creature) { sanitizer.Clean(); }
public ActionResult <CleaningResult> Post(Instructions instructions) { return(_cleaner.Clean(instructions)); }