public StoredCombatStatisticsProjectionRepository(IStoredCombatStatisticsRepository storedCombatStatisticsRepository, IObjectMapperProvider objectMapperProvider) { Guard.WhenArgument(storedCombatStatisticsRepository, nameof(IStoredCombatStatisticsRepository)).IsNull().Throw(); Guard.WhenArgument(objectMapperProvider, nameof(IObjectMapperProvider)).IsNull().Throw(); this.storedCombatStatisticsRepository = storedCombatStatisticsRepository; this.objectMapperProvider = objectMapperProvider; }
public void ThrowArgumentNullException_WhenIStoredCombatStatisticsRepositoryParameterIsNull() { // Arrange IStoredCombatStatisticsRepository storedCombatStatisticsRepository = null; var objectMapperProvider = new Mock <IObjectMapperProvider>(); // Act & Assert Assert.That( () => new StoredCombatStatisticsProjectionRepository(storedCombatStatisticsRepository, objectMapperProvider.Object), Throws.InstanceOf <ArgumentNullException>().With.Message.Contains(nameof(IStoredCombatStatisticsRepository))); }