public void Setup() { _mockCommandDispatcher = new Mock <ICommandDispatcher>(); _fixture = new Fixture(); _sut = new ApplicationCommandController(_mockCommandDispatcher.Object); _mockCommandDispatcher .Setup(m => m.Send(It.IsAny <UpsertLegalEntityCommand>(), It.IsAny <CancellationToken>())) .Returns(Task.CompletedTask); }
internal ApplicationCommandControllerTestExecutionContext(ISimpleLogger simpleLogger) { SimpleLogger = simpleLogger; var controller = new ApplicationCommandController(SimpleLogger, RecordApplicationFeedbackAsync); Controller = controller; ExecutionContext = controller; FeedbacksToApplication = new List <IFeedbackToApplication>(); FeedbacksToApplicationLock = new object(); }
public PureSearchWindow() { var container = new ContainerBuilder().UsePegh("PureSearch", new DummyCsArgumentPrompter()).Build(); SimpleLogger = container.Resolve <ISimpleLogger>(); MethodNamesFromStackFramesExtractor = container.Resolve <IMethodNamesFromStackFramesExtractor>(); SynchronizationContext = SynchronizationContext.Current; Controller = new ApplicationCommandController(SimpleLogger, HandleFeedbackToApplicationAsync); SearchApplication = new SearchApplication(Controller, this, this, this); InitializeComponent(); GetRegistry(); }
public WakekWindow() { Controller = new ApplicationCommandController(HandleFeedbackToApplicationAsync); UiSynchronizationContext = SynchronizationContext.Current; var container = new ContainerBuilder().UseWakek().Build(); WakekApplication = new WakekApplication(Controller, Controller, UiSynchronizationContext, NavigateToStringReturnContentAsNumber, container.Resolve <ISecretRepository>(), container.Resolve <IXmlSerializedObjectReader>(), container.Resolve <IBenchmarkExecutionFactory>(), container.Resolve <IXmlSerializer>(), container.Resolve <ITelemetryDataReader>(), container.Resolve <IHttpClientFactory>()); InitializeComponent(); }
public MainWindow() { InitializeComponent(); Title = Properties.Resources.MainWindowTitle; CommandController = new ApplicationCommandController(ApplicationFeedbackHandler); CommandController.AddCommand(new DoSomethingCommand(), true); CommandController.AddCommand(new PrimeNumbersCommand(), true); DoSomething.Click += ExecuteRoutedCommand <DoSomethingCommand>; PrimeNumbers.Click += ExecuteRoutedCommand <PrimeNumbersCommand>; ApplicationFeedbackHandler(new FeedbackToApplication { Type = FeedbackType.CommandsEnabledOrDisabled }); }
public WakekTestApplication(IHttpClientFactory httpClientFactory) { var container = new ContainerBuilder().UseWakek().Build(); // var componentProviderMock = new Mock<IWakekComponentProvider>(); var telemetryDataReaderMock = new Mock <ITelemetryDataReader>(); IList <ITelemetryData> result = new List <ITelemetryData> { new TelemetryData { ExecutingForHowManyMilliSeconds = 24, RequiringForHowManyMilliSeconds = 7 } }; telemetryDataReaderMock.Setup(t => t.ReadAsync(It.IsAny <IBenchmarkDefinition>())).Returns(Task.FromResult(result)); ApplicationCommandController = new ApplicationCommandController(HandleFeedbackToApplicationAsync); WrappedWakekApplication = new WakekApplication(ApplicationCommandController, ApplicationCommandController, SynchronizationContext.Current, NavigateToStringReturnContentAsNumber, container.Resolve <ISecretRepository>(), container.Resolve <IXmlSerializedObjectReader>(), container.Resolve <IBenchmarkExecutionFactory>(), container.Resolve <IXmlSerializer>(), telemetryDataReaderMock.Object, httpClientFactory); }
public void Setup() { _mockCommandDispatcher = new Mock <ICommandDispatcher>(); _fixture = new Fixture(); _sut = new ApplicationCommandController(_mockCommandDispatcher.Object); }