public void ThrowArgumentNullException_WhenICommandParameterIsNull() { // Arrange var commandResolutionHandler = new Mock <ICommandResolutionHandler>(); var combatStatisticsContainer = new Mock <ICombatStatisticsContainer>(); var combatStatisticsFinalizationStrategy = new Mock <ICombatStatisticsFinalizationStrategy>(); var combatStatisticsPersistentStorageStrategy = new Mock <ICombatStatisticsPersistentStorageStrategy>(); var liveCombatStatisticsCreationStrategy = new Mock <ILiveCombatStatisticsCreationStrategy>(); ICommand command = null; var logFileParserEngine = new LogFileParserEngine(commandResolutionHandler.Object, combatStatisticsContainer.Object, combatStatisticsFinalizationStrategy.Object, combatStatisticsPersistentStorageStrategy.Object, liveCombatStatisticsCreationStrategy.Object); // Act & Assert Assert.That( () => logFileParserEngine.EnqueueCommand(command), Throws.InstanceOf <ArgumentNullException>().With.Message.Contains(nameof(ICommand))); }
public void CreateCorrectILogFileParserEngineInstance_WhenParametersAreValid() { // Arrange var commandResolutionHandler = new Mock <ICommandResolutionHandler>(); var combatStatisticsContainer = new Mock <ICombatStatisticsContainer>(); var combatStatisticsFinalizationStrategy = new Mock <ICombatStatisticsFinalizationStrategy>(); var combatStatisticsPersistentStorageStrategy = new Mock <ICombatStatisticsPersistentStorageStrategy>(); var liveCombatStatisticsCreationStrategy = new Mock <ILiveCombatStatisticsCreationStrategy>(); var currentCombatStatisticsChangedSubscribeProvider = new Mock <ICurrentCombatStatisticsChangedSubscribeProvider>(); // Act var actualInstance = new LogFileParserEngine(commandResolutionHandler.Object, combatStatisticsContainer.Object, combatStatisticsFinalizationStrategy.Object, combatStatisticsPersistentStorageStrategy.Object, liveCombatStatisticsCreationStrategy.Object); // Assert Assert.That(actualInstance, Is.Not.Null); Assert.That(actualInstance, Is.InstanceOf <ILogFileParserEngine>()); }