public KataArchive(IEventAggregator eventAggregator, IKataAttemptRepository kataAttemptRepository, IVisualStudioHelper visualStudioHelper, ISettingsManager settingsManager) { if (eventAggregator == null) { throw new ArgumentNullException(nameof(eventAggregator)); } if (kataAttemptRepository == null) { throw new ArgumentNullException(nameof(kataAttemptRepository)); } if (visualStudioHelper == null) { throw new ArgumentNullException(nameof(visualStudioHelper)); } if (settingsManager == null) { throw new ArgumentNullException(nameof(settingsManager)); } _eventAggregator = eventAggregator; _kataAttemptRepository = kataAttemptRepository; _visualStudioHelper = visualStudioHelper; _settingsManager = settingsManager; }
private static KataArchive Create(IEventAggregator eventAggregator = null, IKataAttemptRepository kataAttemptRepository = null, IVisualStudioHelper visualStudioHelper = null, ISettingsManager settingsManager = null) { return(new KataArchive(eventAggregator ?? Substitute.For <IEventAggregator>(), kataAttemptRepository ?? CrateKataAttemptRepositoryWhichProvidesFakeAttempts(), visualStudioHelper ?? CreateAlwaysPositiveVisualStudioHelper(), settingsManager ?? CreateSettingsManagerWhichReturnsSettings())); }