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>())); }
public OpenKataSolutionCommand(IKataArchive kataArchive) { if (kataArchive == null) { throw new ArgumentNullException(nameof(kataArchive)); } _kataArchive = kataArchive; }
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>())); }
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); }
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; }
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; }