예제 #1
0
 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;
 }
예제 #2
0
 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()));
 }