public void AddDataToScenarioRunner(IScenarioRunner runner) { foreach (var d in drawInfo) { runner.AddSprite(d.Bitmap, d.Tint, d.Position, d.Rotation); } }
CpuGpuTime RunScenario(IScenarioRunner runner, CanvasRenderTarget rt) { while (true) { Stopwatch stopWatch = new Stopwatch(); using (GpuStopWatch gpuStopWatch = new GpuStopWatch(rt.Device)) { gpuStopWatch.Start(); stopWatch.Start(); using (var ds = rt.CreateDrawingSession()) { ds.Clear(Colors.Black); runner.RunScenario(ds, SortMode); } stopWatch.Stop(); gpuStopWatch.Stop(); var gpuTime = gpuStopWatch.GetGpuTimeInMs(); if (gpuTime < 0) { // try again until we get a time that isn't disjoint continue; } return(new CpuGpuTime { CpuTimeInMs = stopWatch.Elapsed.TotalMilliseconds, GpuTimeInMs = gpuTime }); } } }
public QueueListener(IQueueListenerConfiguration config, IQueue queue, IScenarioRunner scenarioRunner, IProgressReporter progressReporter, ITimeProvider timeProvider) { _config = config; _queue = queue; _scenarioRunner = scenarioRunner; _progressReporter = progressReporter; _timeProvider = timeProvider; }
public static async Task RunAsyncWithTimeout(this IScenarioRunner <NoContext> runner, int timeout = 10000) { CancellationTokenSource taskCancel = new CancellationTokenSource(); Task runnerTask = runner.RunAsync(); Task completedTask = await Task.WhenAny(runnerTask, Task.Delay(timeout, taskCancel.Token)); completedTask.Should().Be(runnerTask, $"test should have finished in {(double) timeout / 1000:F}s"); taskCancel.Cancel(); completedTask.WaitAndUnwrapException(CancellationToken.None); }
public void Install(TinyIoCContainer container) { serviceProvider = container.Resolve<IServiceProvider>(); outputWindow = container.Resolve<IOutputWindow>(); scenarioRunner = container.Resolve<IScenarioRunner>(); var mcs = serviceProvider.GetService(typeof (IMenuCommandService)) as OleMenuCommandService; if (mcs == null) return; var menuCommandId = new CommandID((Identifiers.CommandGroupSet), (int) Identifiers.RunCommandId); var menuItem = new MenuCommand(RunCommandOnClick, menuCommandId); mcs.AddCommand(menuItem); var debugCommandId = new CommandID((Identifiers.CommandGroupSet), (int) Identifiers.DebugCommandId); var debugItem = new MenuCommand(DebugCommandOnClick, debugCommandId); mcs.AddCommand(debugItem); }
public void Install(TinyIoCContainer container) { serviceProvider = container.Resolve <IServiceProvider>(); outputWindow = container.Resolve <IOutputWindow>(); scenarioRunner = container.Resolve <IScenarioRunner>(); var mcs = serviceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService; if (mcs == null) { return; } var menuCommandId = new CommandID((Identifiers.CommandGroupSet), (int)Identifiers.RunCommandId); var menuItem = new MenuCommand(RunCommandOnClick, menuCommandId); mcs.AddCommand(menuItem); var debugCommandId = new CommandID((Identifiers.CommandGroupSet), (int)Identifiers.DebugCommandId); var debugItem = new MenuCommand(DebugCommandOnClick, debugCommandId); mcs.AddCommand(debugItem); }
public MockBddRunner(IntegrationContext ctx, IScenarioRunner scenarioRunner) { _ctx = ctx; _scenarioRunner = scenarioRunner; }
public ScenarionsInitializer(IScenarioRunner scenarioRunner) { _scenarioRunner = scenarioRunner; }
CpuGpuTime RunScenario(IScenarioRunner runner, CanvasRenderTarget rt) { while (true) { Stopwatch stopWatch = new Stopwatch(); using (GpuStopWatch gpuStopWatch = new GpuStopWatch(rt.Device)) { gpuStopWatch.Start(); stopWatch.Start(); using (var ds = rt.CreateDrawingSession()) { ds.Clear(Colors.Black); runner.RunScenario(ds, SortMode); } stopWatch.Stop(); gpuStopWatch.Stop(); var gpuTime = gpuStopWatch.GetGpuTimeInMs(); if (gpuTime < 0) { // try again until we get a time that isn't disjoint continue; } return new CpuGpuTime { CpuTimeInMs = stopWatch.Elapsed.TotalMilliseconds, GpuTimeInMs = gpuTime }; } } }
public ScenariosController(ILoggerService loggerService, IScenarioRunner scenarioRunner, IDataAccessService dataAccessService) { _logger = loggerService.GetLogger(nameof(ScenariosController)); _scenarioRunner = scenarioRunner; _dataAccessService = dataAccessService; }
public MockBddRunner(LightBddConfiguration configuration, IScenarioRunner scenarioRunner) { _configuration = configuration; _scenarioRunner = scenarioRunner; }