Example #1
0
        public CodeManager CM(string path)
        {
            var loggerMock = new LoggerMock().Logger;
            var config     = new YamlConfig(CreateSettings(path));

            var(daemonApps, _) = DaemonCompiler.GetDaemonApps(path, loggerMock);
            return(new CodeManager(daemonApps, loggerMock, config));
        }
Example #2
0
        public void FaultyApplicationShouldLogError()
        {
            // ARRANGE
            var path       = Path.Combine(FaultyAppPath, "CompileErrors");
            var loggerMock = new LoggerMock();

            var(daemonApps, _) = DaemonCompiler.GetDaemonApps(path, loggerMock.Logger);
            var netDaemonSettings = CreateSettings(path);

            // ACT
            var cm = new CodeManager(daemonApps, loggerMock.Logger, new YamlConfig(netDaemonSettings));

            // ASSERT
            loggerMock.AssertLogged(LogLevel.Error, Times.AtLeastOnce());
        }
Example #3
0
        public void InsanceAppsThatHasMissingExecuteAndSupressLogsShouldNotLogError()
        {
            // ARRANGE
            var path      = Path.Combine(FaultyAppPath, "SupressLogs");
            var moqDaemon = new Mock <INetDaemonHost>();
            var moqLogger = new LoggerMock();

            var(daemonApps, _) = DaemonCompiler.GetDaemonApps(path, moqLogger.Logger);
            var configMock = new Mock <IYamlConfig>();

            // ACT
            var codeManager = new CodeManager(daemonApps, moqLogger.Logger, configMock.Object);

            // ASSERT
            moqLogger.AssertLogged(LogLevel.Error, Times.Exactly(1));
        }