public void TimeoutLoggedTest()
        {
            // Arrange
            var        log    = new Mock <IExceptionLogger>();
            CodeRunner runner = new CodeRunner(log.Object);
            string     code   = GetUsings(new string[] { "System" })
                                .Append(WrapInMain(@"while(true) {}")).ToString();

            // Act
            Exception e = Assert.ThrowsAsync(typeof(TimeoutException), () =>
                                             runner.CompileAndRunAsync(code));

            // Assert
            log.Verify(l => l.LogException(e, code));
        }
        public void CompilerErrorNotLoggedTest()
        {
            // Arrange
            var        log    = new Mock <IExceptionLogger>();
            CodeRunner runner = new CodeRunner(log.Object);
            string     code   = GetUsings(new string[] { "System" })
                                .Append(WrapInMain(@"int i")).ToString();

            // Act
            Exception e = Assert.ThrowsAsync(typeof(CompilationErrorException), () =>
                                             runner.CompileAndRunAsync(code));

            // Assert
            log.Verify(l => l.LogException(It.IsAny <Exception>(), It.IsAny <string>()), Times.Never());
        }