示例#1
0
 private IKataPracticeMenuItemProvider Create(IKataArchive kataArchive         = null,
                                              ICommandHelper commandHelper     = null,
                                              IEventAggregator eventAggregator = null)
 {
     return(new KataPracticeMenuItemProvider(kataArchive ?? Substitute.For <IKataArchive>(),
                                             commandHelper ?? Substitute.For <ICommandHelper>(),
                                             eventAggregator ?? Substitute.For <IEventAggregator>()));
 }
示例#2
0
 public OpenKataSolutionCommand(IKataArchive kataArchive)
 {
     if (kataArchive == null)
     {
         throw new ArgumentNullException(nameof(kataArchive));
     }
     _kataArchive = kataArchive;
 }
示例#3
0
 private GenerateAndLaunchKataCommand Create(KataName kataName                = KataName.Unknown,
                                             IKataArchive kataArchive         = null,
                                             ICommandHelper commandHelper     = null,
                                             IEventAggregator eventAggregator = null)
 {
     return(new GenerateAndLaunchKataCommand(kataName,
                                             kataArchive ?? Substitute.For <IKataArchive>(),
                                             commandHelper ?? Substitute.For <ICommandHelper>(),
                                             eventAggregator ?? Substitute.For <IEventAggregator>()));
 }
示例#4
0
        private IKataAttempt GenerateAndLaunchKata(IKataArchive kataArchive, KataName selectedKata)
        {
            var kataAttempt = kataArchive.GenerateSolutionForAttempt(selectedKata);

            if (kataAttempt == null)
            {
                _traceLoggerHelper.LogToUi("Failed to find solution template for [ " + kataArchive + " ]");
                return(null);
            }

            var launchAction = kataArchive.GenerateLaunchActionFor(kataAttempt.Location);

            launchAction.Invoke();
            _eventAggregator.Publish <ShowMainWindowEvent>();
            return(kataAttempt);
        }
示例#5
0
        public IKataAttempt GenerateAndLaunchKata(object parameter, IKataArchive kataArchive)
        {
            KataName selectedKata;

            var kataNameString = parameter.ToString();

            if (Enum.TryParse(kataNameString, true, out selectedKata))
            {
                return(GenerateAndLaunchKata(kataArchive, selectedKata));
            }
            else
            {
                _traceLoggerHelper.LogToUi("Unable to find Kata type [ " + kataNameString + " ]");
                return(null);
            }
        }
 public KataPracticeMenuItemProvider(IKataArchive kataArchive,
                                     ICommandHelper commandHelper,
                                     IEventAggregator eventAggregator)
 {
     if (kataArchive == null)
     {
         throw new ArgumentNullException(nameof(kataArchive));
     }
     if (commandHelper == null)
     {
         throw new ArgumentNullException(nameof(commandHelper));
     }
     if (eventAggregator == null)
     {
         throw new ArgumentNullException(nameof(eventAggregator));
     }
     _kataArchive     = kataArchive;
     _commandHelper   = commandHelper;
     _eventAggregator = eventAggregator;
 }
示例#7
0
 public GenerateAndLaunchKataCommand(KataName kata,
                                     IKataArchive kataArchive,
                                     ICommandHelper commandHelper,
                                     IEventAggregator eventAggregator)
 {
     if (kataArchive == null)
     {
         throw new ArgumentNullException(nameof(kataArchive));
     }
     if (commandHelper == null)
     {
         throw new ArgumentNullException(nameof(commandHelper));
     }
     if (eventAggregator == null)
     {
         throw new ArgumentNullException(nameof(eventAggregator));
     }
     _kata            = kata;
     _kataArchive     = kataArchive;
     _commandHelper   = commandHelper;
     _eventAggregator = eventAggregator;
 }