/// <summary> /// Initializes a new instance of the <see cref="TestResultReportModel"/> class. /// </summary> /// <param name="syncServiceDocumentModel">The <see cref="ISyncServiceDocumentModel"/> to obtain document settings.</param> /// <param name="viewDispatcher"> Instance of <see cref="IViewDispatcher"/> of associated view.</param> /// <param name="testAdapter"><see cref="ITfsTestAdapter"/> to examine test information.</param> /// <param name="wordRibbon">Interface to the word ribbon</param> /// <param name="testReportingProgressCancellationService">The <see cref="ITestReportingProgressCancellationService"/> indicating that a cancellation is requested.</param> protected TestReportModel(ISyncServiceDocumentModel syncServiceDocumentModel, IViewDispatcher viewDispatcher, ITfsTestAdapter testAdapter, IWordRibbon wordRibbon, ITestReportingProgressCancellationService testReportingProgressCancellationService) { if (syncServiceDocumentModel == null) { throw new ArgumentNullException("syncServiceDocumentModel"); } if (testAdapter == null) { throw new ArgumentNullException("testAdapter"); } if (wordRibbon == null) { throw new ArgumentNullException("wordRibbon"); } if (testReportingProgressCancellationService == null) { throw new ArgumentNullException("testReportingProgressCancellationService"); } if (viewDispatcher == null) { throw new ArgumentNullException("viewDispatcher"); } SyncServiceDocumentModel = syncServiceDocumentModel; WordRibbon = wordRibbon; TestAdapter = testAdapter; ViewDispatcher = viewDispatcher; Document = syncServiceDocumentModel.WordDocument as Document; _modelKey = GetType().Name; _storedData = new Dictionary <string, string>(); ParseStoredData(SyncServiceDocumentModel.ReadTestReportData(_modelKey)); _generatingActive = SyncServiceDocumentModel.TestReportRunning; _operationActive = SyncServiceDocumentModel.TestReportRunning; TestReportingProgressCancellationService = testReportingProgressCancellationService; }
public MainWindowViewModel( IEventBroker <ClickerEventArgs> eventBroker, ISubscribesContainer <ClickerEventArgs> subscribeContainer, IViewDispatcher dispatcher, IClickerFactory clickerFactory, IDelayRangeProvider delayRangeProvider, IAreaRectProvider areaRectProvider, IFixedDelayProvider fixedDelayProvider ) { _eventBroker = eventBroker ?? throw new NullReferenceException(nameof(eventBroker)); _subscribeContainer = subscribeContainer ?? throw new NullReferenceException(nameof(subscribeContainer)); _dispatcher = dispatcher ?? throw new NullReferenceException(nameof(dispatcher)); _clickerFactory = clickerFactory ?? throw new NullReferenceException(nameof(clickerFactory)); _delayRangeProvider = delayRangeProvider ?? throw new NullReferenceException(nameof(delayRangeProvider)); _areaRectProvider = areaRectProvider ?? throw new NullReferenceException(nameof(areaRectProvider)); _fixedDelayProvider = fixedDelayProvider ?? throw new NullReferenceException(nameof(fixedDelayProvider)); _deltaValue = Constants.DeltaValue; Init(); Subscribe(); }
/// <summary> /// Initializes a new instance of the <see cref="TestSpecificationReportModel"/> class. /// </summary> /// <param name="syncServiceDocumentModel">The <see cref="ISyncServiceModel"/> to obtain document settings.</param> /// <param name="dispatcher">Dispatcher of associated view.</param> /// <param name="testAdapter"><see cref="ITfsTestAdapter"/> to examine test information.</param> /// <param name="wordRibbon">Interface to the word ribbon</param> /// <param name="testReportingProgressCancellationService">The progess cancellation service used to check at certain points if a cancellation has been triggered and further steps should be skipped.</param> public TestSpecificationReportModel(ISyncServiceDocumentModel syncServiceDocumentModel, IViewDispatcher dispatcher, ITfsTestAdapter testAdapter, IWordRibbon wordRibbon, ITestReportingProgressCancellationService testReportingProgressCancellationService) : base(syncServiceDocumentModel, dispatcher, testAdapter, wordRibbon, testReportingProgressCancellationService) { CreateDocumentStructure = StoredCreateDocumentStructure; SkipLevels = StoredSkipLevels; SelectedDocumentStructureType = StoredSelectedDocumentStructureType; SelectedTestCaseSortType = StoredSelectedTestCaseSortType; CreateReportCommand = new ViewCommand(ExecuteCreateReportCommand, CanExecuteCreateReportCommand); SetTestReportDefaults(syncServiceDocumentModel.Configuration.ConfigurationTest.ConfigurationTestSpecification.DefaultValues); WordDocument = syncServiceDocumentModel.WordDocument as Document; }