public void TestResultReportingFailure()
        {
            var fakeCmdlet = new FakeGCloudCmdlet();

            fakeCmdlet.ShouldThrowException = true;

            var reporter = fakeCmdlet.CmdletResultReporter as InMemoryCmdletResultReporter;

            Assert.Throws <InvalidOperationException>(() => fakeCmdlet.SimulateInvocation());
            fakeCmdlet.Dispose();

            Assert.IsTrue(reporter.ContainsEvent("Test-GCloudCmdlets", "Default", FakeGCloudCmdlet.project, 1));
        }
        public void TestResultReportingSuccess()
        {
            var fakeCmdlet = new FakeGCloudCmdlet();
            var reporter   = fakeCmdlet.CmdletResultReporter as InMemoryCmdletResultReporter;

            try
            {
                fakeCmdlet.SimulateInvocation();
            }
            finally
            {
                fakeCmdlet.Dispose();
            }

            Assert.IsTrue(reporter.ContainsEvent("Test-GCloudCmdlets", "Default", FakeGCloudCmdlet.project));
        }