コード例 #1
0
        public void ThrowArgumentException_WhenLogFileParserEnginesDictionaryDoesNotContainTheRequestedKey()
        {
            // Arrange
            var guidStringProvider         = new Mock <IGuidStringProvider>();
            var logFileParserEngineFactory = new Mock <ILogFileParserEngineFactory>();

            var engineId = "any engine id";

            var logFileParserEngineManager = new LogFileParserEngineManager(guidStringProvider.Object, logFileParserEngineFactory.Object);

            // Act & Assert
            Assert.That(
                () => logFileParserEngineManager.StopLogFileParserEngine(engineId),
                Throws.InstanceOf <ArgumentException>().With.Message.Contains("Requested engine not found."));
        }
コード例 #2
0
        public void ThrowArgumenException_WhenEngineIdParameterIsNull()
        {
            // Arrange
            var guidStringProvider         = new Mock <IGuidStringProvider>();
            var logFileParserEngineFactory = new Mock <ILogFileParserEngineFactory>();

            var engineId = string.Empty;

            var logFileParserEngineManager = new LogFileParserEngineManager(guidStringProvider.Object, logFileParserEngineFactory.Object);

            // Act & Assert
            Assert.That(
                () => logFileParserEngineManager.StopLogFileParserEngine(engineId),
                Throws.InstanceOf <ArgumentException>().With.Message.Contains(nameof(engineId)));
        }