public void Trim_trailing_whitespace()
        {
            const string text   = "Deadpool                    ";
            var          actual = _cleaner.Clean(text);

            Assert.That(actual, Is.EqualTo(new [] { "Deadpool" }));
        }
Пример #2
0
        private bool ReadCommand(out int commandNumber)
        {
            writer.Write(this.menu.Show());
            bool result = int.TryParse(this.reader.ReadLine(), out commandNumber);

            cleaner.Clean();
            return(result);
        }
Пример #3
0
        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());
        }
Пример #6
0
        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);
            }
        }
Пример #7
0
 /// <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)
 {
 }
Пример #8
0
 public SizeDefiningObjectPoolProvider(int sizeOfElement, ICreator <T> creator, ICleaner <T> cleaner = null)
     : this(sizeOfElement, () => creator.Create(), obj => cleaner.Clean(obj))
 {
 }
Пример #9
0
 public void DoWork()
 {
     Console.WriteLine("Doing Carpentry");
     _clean.Clean();
 }
Пример #10
0
 public void Clean(ICleaner sanitizer, CreatureList.Creature creature)
 {
     sanitizer.Clean();
 }
Пример #11
0
 public ActionResult <CleaningResult> Post(Instructions instructions)
 {
     return(_cleaner.Clean(instructions));
 }