public void HazelcastTestBaseTearDown()
        {
            // in case it's been used by tests, reset the clock
            // (after each test)
            Clock.Reset();

            // same for console
            HConsole.WriteAndClear();
        }
Example #2
0
        public void WriteAndClear()
        {
            var capture = new ConsoleCapture();

            HConsole.WriteAndClear();
            Assert.That(HConsole.Text.Length, Is.Zero);

            HConsole.WriteAndClear();
            Assert.That(HConsole.Text.Length, Is.Zero);

            HConsole.Configure(x => x.Set(xx => xx.Verbose()));
            HConsole.WriteLine(this, "meh");
            Assert.That(HConsole.Text.Length, Is.GreaterThan(0));

            using (capture.Output())
            {
                HConsole.WriteAndClear();
            }

            Assert.That(HConsole.Text.Length, Is.Zero);
            Assert.That(capture.ReadToEnd(), Does.EndWith("meh" + Environment.NewLine));

            HConsole.WriteLine(this, "meh");
            Assert.That(HConsole.Text.Length, Is.GreaterThan(0));

            using (capture.Output())
            {
                HConsole.Clear();
            }

            Assert.That(HConsole.Text.Length, Is.Zero);
            Assert.That(capture.ReadToEnd().Length, Is.Zero);

            HConsole.WriteLine(this, "meh");
            using (capture.Output())
            {
                using (HConsole.Capture()) { }
            }

            Assert.That(HConsole.Text.Length, Is.Zero);
            Assert.That(capture.ReadToEnd(), Does.EndWith("meh" + Environment.NewLine));
        }
Example #3
0
 public void HazelcastTestBaseOneTimeRootTearDown()
 {
     // write console output & clear
     HConsole.WriteAndClear();
 }