public async Task TestCopyQuestion() { //Prepare TestingContext context = new TestingContext(); InitContext(context); ApplicationDbContext dbContext = context.GetSimple <ApplicationDbContext>(); Question question = dbContext.Questions.First(); context.AddPrincipalMock(question.User.UserId, Roles.User); IQuestionService questionService = context.GetService <QuestionService>(); context.DependencyMap[typeof(IQuestionService)] = questionService; IVersionService versionService = context.GetService <VersionService>(); //Act int newId = await versionService.CopyQuestionAsync(question.Id); //Assert Assert.True(question.Id != newId); Assert.True(newId > 0); QuestionDto newQuestion = await questionService.GetQuestionAsync(newId); Assert.Equal(question.Options.Count, newQuestion.Options.Count); Assert.Equal(question.QuestionType, newQuestion.QuestionType); for (int i = 0; i < question.Options.Count; i++) { QuestionOption optionSource = question.Options[i]; QuestionOptionDto optionDestination = newQuestion.Options[i]; Assert.NotEqual(optionSource.Id, optionDestination.Id); Assert.True(optionDestination.Id > 0); } }
public DataController(ISecurityService securityService, IBinaryService binaryService, IQuestionService questionService, IVersionService versionService, ITagService tagService, ICourseService courseService, ICommentsService commentsService, IUserProfileService userProfileService, ICourseInstanceService courseInstanceService, ITextService textService, IExportService exportService, INotificationService notificationService, IFavoriteService favoriteService) { _securityService = securityService; _binaryService = binaryService; _questionService = questionService; _tagService = tagService; _courseService = courseService; _commentsService = commentsService; _userProfileService = userProfileService; _courseInstanceService = courseInstanceService; _textService = textService; _exportService = exportService; _versionService = versionService; _notificationService = notificationService; _favoriteService = favoriteService; }
public static IApplicationBuilder UseMonitoringEndpoint( this IApplicationBuilder app, Action <HealthCheckOptions> optionsSetup = null) { if (app == null) { throw new ArgumentNullException(nameof(app)); } var provider = app.ApplicationServices; var collector = provider.GetRequiredService <IResourceStateCollector>(); collector.Start(); var lifetime = provider.GetService <IApplicationLifetime>(); lifetime?.ApplicationStopping.Register(() => collector.Stop()); var options = new HealthCheckOptions(); optionsSetup?.Invoke(options); IVersionService versionService = null; if (options.IncludeVersionInformation) { versionService = provider.GetService <IVersionService>(); } return(app.Map( options.Path, m => m.UseMiddleware <HealthCheckMiddleware>(collector, options.ToStringStrategy, versionService))); }
/// public void Initialize(IProxyConfig proxyConfig, string host, int port) { if (IsInitialized) { return; } // Create version service var binding = new BasicHttpBinding { SendTimeout = new TimeSpan(0, 0, 2), OpenTimeout = new TimeSpan(0, 0, 2) }; //Set proxy SetProxyOnBinding(proxyConfig, binding); var url = $@"http://{host}:{port}/{ServiceName}"; var endpoint = new EndpointAddress(url); var channelFactory = new ChannelFactory <IVersionService>(binding); channelFactory.Endpoint.Behaviors.Add(new CultureBehavior()); _versionService = channelFactory.CreateChannel(endpoint); IsInitialized = true; }
public CollectionMigrationRunner( IMongoMigrationSettings settings, ICollectionLocator collectionLocator, IVersionService versionService, IMigrationRunner migrationRunner) : this( collectionLocator, versionService, migrationRunner) { if (settings.ConnectionString == null && settings.Database == null || settings.ClientSettings == null) { throw new MongoMigrationNoMongoClientException(); } if (settings.ClientSettings != null) { _client = new MongoClient(settings.ClientSettings); } else { _client = new MongoClient(settings.ConnectionString); } _databaseName = settings.Database; }
public FooterService( IDataService dataService, IVersionService versionService) { this.dataService = dataService; this.versionService = versionService; }
public SQLiteGenerator(IDataGenerationJobService jobService, IVersionService versionService, AnmatConfiguration configuration) { this.scriptBuilder = new StringBuilder(); this.jobService = jobService; this.versionService = versionService; this.configuration = configuration; }
public VersionController( IMapper mapper, IVersionService versionService ) : base(mapper) { _versionService = versionService; }
public SourcesViewModel( IChocolateyService packageService, IConfigService configService, IImageService imageService, IEventAggregator eventAggregator, IVersionService versionService, Func <string, LocalSourceViewModel> localSourceVmFactory, CreateRemove remoteSourceVmFactory) { _packageService = packageService; _configService = configService; _imageService = imageService; _versionService = versionService; _remoteSourceVmFactory = remoteSourceVmFactory; if (localSourceVmFactory == null) { throw new ArgumentNullException(nameof(localSourceVmFactory)); } if (remoteSourceVmFactory == null) { throw new ArgumentNullException(nameof(remoteSourceVmFactory)); } Items.Add(localSourceVmFactory(Resources.Resources_ThisPC)); #pragma warning disable 4014 LoadSources(); #pragma warning restore 4014 eventAggregator.Subscribe(this); }
public VersionApiController( IVersionService versionService, ILoginUserRepository loginUserRepository ) : base(loginUserRepository) { _versionService = versionService; }
public UpdateViewModel( ICompressedFileManager compressedFileManager, IDirectoryManager directoryManager, IFileManager fileManager, IProcessManager processManager, IVersionService versionService, IMessagePublisher messagePublisher) { this.compressedFileManager = compressedFileManager; this.directoryManager = directoryManager; this.fileManager = fileManager; this.processManager = processManager; this.messagePublisher = messagePublisher; // Setup update information this.latestVersion = versionService.LatestVersion; var latestReleaseInfo = versionService.GetLatestReleaseInfo(); if (latestReleaseInfo == null) { return; } this.downloadUrl = latestReleaseInfo.DownloadUrl; this.Changes = latestReleaseInfo.Changes; this.web.DownloadProgressChanged += WebDownloadProgressChanged; this.web.DownloadFileCompleted += WebDownloadFileCompleted; this.ButtonsEnabled = true; }
public async Task TestGetVersions() { //Prepare TestingContext testingContext = new TestingContext(); SetUpTestingContext(testingContext); ApplicationDbContext dbContext = testingContext.GetSimple <ApplicationDbContext>(); Question question = dbContext.Questions.First(); testingContext.AddPrincipalMock(question.User.UserId, Roles.User); testingContext.AddBusinessSecurityService(); IQuestionService questionService = testingContext.GetService <QuestionService>(); testingContext.DependencyMap[typeof(IQuestionService)] = questionService; IVersionService versionService = testingContext.GetService <VersionService>(); int newId = await versionService.VersionQuestionAsync(question.Id); await versionService.AcceptQuestionAsync(newId); VersionInfoParametersDto versionInfoParametersDto = new VersionInfoParametersDto() { Page = 0, IdQuestion = newId, }; //Act PagedResultDto <VersionInfoDto> result = await versionService.GetVersionsAsync(versionInfoParametersDto); //Assert Assert.Equal(2, result.Count); }
public LoadingViewModel(Type mainpage, INavigation navigation) { _mainpage = mainpage; string dbSql = DependencyService.Get <ISQLite>().GetLocalFilePath("db.sqlite3"); _jsonService = new JsonService(); _versionService = new VersionService(dbSql); _getClientParamService = new GetClientParamService(dbSql); IsLoading = true; TextLoading = "Vérification du fichier de configuration..."; // Get config file var jsonObject = Utils.DeserializeFromJson <JsonModel>(_jsonService.GetJson()); //var jsonObject = Utils.DeserializeFromJson<JsonModel>("{\"Version\": \"1.0.0.0\",\"Companies\": [{\"CompanyName\": \"e-Kenz\",\"Url\": \"http://navapi.saas.e-kenz.com\", \"Domain\": \"SAAS\"},{\"CompanyName\": \"Company1\",\"Url\": \"URL1\", \"Domain\": \"Domain1\"},{\"CompanyName\": \"Company2\",\"Url\": \"URL2\", \"Domain\": \"Domain2\"}]}"); CreateTables(dbSql); PopulateDb(dbSql, jsonObject); //Task.Run(async () => await CreateTablesAsync(dbSql)); //Task.Run(async () => await PopulateDb(dbSql, jsonObject)); Device.StartTimer(TimeSpan.FromSeconds(2), () => { Device.BeginInvokeOnMainThread(async() => await SwitchPage()); return(false); }); }
public SourcesViewModel( IChocolateyService packageService, IConfigService configService, IImageService imageService, IEventAggregator eventAggregator, IVersionService versionService, Func <string, LocalSourceViewModel> localSourceVmFactory, CreateRemove remoteSourceVmFactory) { _packageService = packageService; _configService = configService; _imageService = imageService; _versionService = versionService; _remoteSourceVmFactory = remoteSourceVmFactory; _localSourceVmFactory = localSourceVmFactory; if (localSourceVmFactory == null) { throw new ArgumentNullException(nameof(localSourceVmFactory)); } if (remoteSourceVmFactory == null) { throw new ArgumentNullException(nameof(remoteSourceVmFactory)); } eventAggregator.Subscribe(this); }
public void TestFixtureSetUp() { _hogController = new HeartOfGoldController { RuntimeDir = HogHelper.RuntimeDir, ConfigDir = HogHelper.ConfigDirParam, ExecutionTimeout = 120 }; Console.WriteLine("Starting HeartOfGold"); var started = _hogController.StartApplication(); _hogController.CreateClients(); Assert.IsTrue(started, "Can't start HeartOfGold."); Assert.IsFalse(_hogController.Process.HasExited, "HeartOfGold has exited unexpectedly."); var result = _hogController.WaitForService(DependentTestModule.ModuleController.ModuleName, ServerModuleState.Running, 10); Assert.IsTrue(result, "Service 'TestModule' did not reach state 'Running'"); var channelFactory = new ChannelFactory <IVersionService>(BindingFactory.CreateDefaultBasicHttpBinding(false, null)); _versionService = channelFactory.CreateChannel(new EndpointAddress($"http://localhost:{_hogController.HttpPort}/ServiceVersions")); Assert.NotNull(_versionService, "Can't create VersionServiceClient"); }
private static void CheckUpdates(IVersionService versionService) { if (!Settings.Default.LastUpdateCheck.HasValue || DateTime.Now > Settings.Default.LastUpdateCheck.Value.AddDays(7)) { versionService.GetOnlineVersionAsync(); } }
public SqlProjectService(IVersionService versionService, IFileSystemAccess fileSystemAccess, ILogger logger) { _versionService = versionService ?? throw new ArgumentNullException(nameof(versionService)); _fileSystemAccess = fileSystemAccess ?? throw new ArgumentNullException(nameof(fileSystemAccess)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
public EventStore(IOptions <DomainDbConfiguration> settings, IEventDocumentFactory eventDocumentFactory, IVersionService versionService) { _dbContext = new DomainDbContext(settings); _eventDocumentFactory = eventDocumentFactory; _versionService = versionService; }
public UpdateService(IPropertiesService propertiesService, IVersionService versionService, ISettingsService settingsService) { _propertiesService = propertiesService; _versionService = versionService; _settingsService = settingsService; _urlHelper = new UrlHelper(propertiesService, "AccountService."); }
public EventStore(IDocumentRepository <EventDocument> eventRepository, IEventDocumentFactory eventDocumentFactory, IVersionService versionService) { _eventRepository = eventRepository; _eventDocumentFactory = eventDocumentFactory; _versionService = versionService; }
public WidgetController(IBus bus, IWidgetDetailsService widgetDetailsService, IPersonService personService, IVersionService versionService, IVersionRolesService versionRolesService) { _bus = bus; _widgetDetailsService = widgetDetailsService; _personService = personService; _versionService = versionService; _versionRolesService = versionRolesService; }
public EventStore(IDomainDbContextFactory dbContextFactory, IEventEntityFactory eventEntityFactory, IVersionService versionService) { _dbContextFactory = dbContextFactory; _eventEntityFactory = eventEntityFactory; _versionService = versionService; }
/// <summary> /// Initializes a new instance of the <see cref="LicensingService"/> class. /// </summary> /// <param name="versionService">The version service.</param> /// <param name="fileSystem">The file system.</param> public LicensingService([NotNull] IVersionService versionService, [NotNull] IFileSystem fileSystem) { Guard.AgainstNullArgument("versionService", versionService); Guard.AgainstNullArgument("fileSystem", fileSystem); this._versionService = versionService; this._fileSystem = fileSystem; }
public AboutPageViewModel( INavigationService navigationService, ITranslationService translationService, IVersionService versionService) : base(navigationService, translationService) { Version = versionService.ApplicationVersion; }
public VersionMediatorServiceTestClass( IVersionFactory versionFactory, IReleaseVersionInformationService versionInformationService, IVersionService versionService, IDesktopServiceSettings desktopServiceSettings, ILogger logger = null) : base(versionFactory, versionInformationService, versionService, desktopServiceSettings, logger) { }
public MainPage() { InitializeComponent(); App.Current.UserAppTheme = OSAppTheme.Unspecified; App.Current.RequestedThemeChanged += Current_RequestedThemeChanged; _versionService = DependencyService.Get <IVersionService>(); }
private CollectionMigrationRunner( ICollectionLocator collectionLocator, IVersionService versionService, IMigrationRunner migrationRunner) { _collectionLocator = collectionLocator; _versionService = versionService; _migrationRunner = migrationRunner; }
public HomeController(IUserService userService, IStatusService statusService, IVersionService versionService, ICategoryService categoryService, IPriorityLevelService priorityLevelService) { _userService = userService; _statusService = statusService; _versionService = versionService; _categoryService = categoryService; _priorityLevelService = priorityLevelService; }
/// public void Dispose() { if (!IsInitialized) { return; } _versionService = null; IsInitialized = false; }
/// <summary> /// Initializes a new instance of the <see cref="VersionController"/> class. /// </summary> /// <param name="versionService">The version service.</param> /// <param name="apkService">The apk service.</param> /// <param name="mapper">The mapper.</param> public VersionController(IVersionService versionService, IMapper mapper, IBundleService bundleService, IDeviceConfigService deviceConfigService) { _versionService = versionService; _mapper = mapper; _bundleService = bundleService; _deviceConfigService = deviceConfigService; }
/// <summary> /// /// </summary> public AppConfigurationRequiredServices(IAppConfigurationServiceSetup serviceSetup, IAppConfigurationEndpointService endpointService, IVersionService versionService, IUserDialogService userDialogService, INetworkService networkService, IFileCacheService fileCacheService) { this.FileCacheService = fileCacheService; this.ServiceSetup = serviceSetup; this.EndpointService = endpointService; this.VersionService = versionService; this.UserDialogService = userDialogService; this.NetworkService = networkService; }
private AnmatContext(IVersionService versionService, IDataGenerationJobService jobService, IDocumentReader documentReader, IEnumerable <IDocumentGenerator> documentGenerators, ISQLGenerator sqlGenerator, AnmatConfiguration configuration) { this.Configuration = configuration; this.VersionService = versionService; this.JobService = jobService; this.DocumentReader = documentReader; this.DocumentGenerators = documentGenerators; this.SQLGenerator = sqlGenerator; }
public DefaultRootApiOperations(ITagsService tags, ITagService tag, IVersionService version, ILayoutsService layouts, ILayoutService layout, ICategoriesService categories, ICategoryService category) { Tags = tags; Tag = tag; Categories = categories; Category = category; Version = version; Layouts = layouts; Layout = layout; }
public VersionModule(IVersionService versionService) :base("/about/version") { this.RequiresAuthentication(); this.RequiresClaims(new string[]{"ApiUser"}); m_VersionService = versionService; Get["/"] = delegate(dynamic parameters) { var version = m_VersionService.GetVersionInformation(); return Response.AsJson(version); }; }
public AboutController(IVersionService service) { _service = service; }
private void InitializeDesignTime(IController controller, IIdleTimeProvider idleTimeProvider, ISummaryDataManager summaryDataManager, IWindowController windowController, IVersionService versionService) { this.ApplicationTitle = Title; this.idleTimeProvider = idleTimeProvider; this.summaryDataManager = summaryDataManager; this.summaryDataManager.Message += (s, e) => { AddMessage(e.Message); }; this.windowController = windowController; this.Messages = new ObservableCollection<string>(); this.DataPointsHashRate = new ObservableCollection<DataPoint>(); this.GraphTimeSpans = new ObservableCollection<GraphTimeSpan>(LoadGraphTimeSpans()); var durations = new List<TimeSpan>(); foreach (string durationText in Settings.Default.SnoozeDurations) { TimeSpan duration; if (TimeSpan.TryParse(durationText, out duration)) { durations.Add(duration); if (duration == Settings.Default.DefaultSnoozeDuration) { this.SnoozeDuration = duration; } } } this.SnoozeDurations = durations; if (!IsDesignMode) { this.InitializeRunTime(controller, versionService); } this.Activity = UserActivity.Active; // initial setting }
public VersionController(IVersionService versionService) { _versionService = versionService; }
private void InitializeRunTime(IController controller, IVersionService versionService) { try { this.SelectedGraphTimeSpan = this.GraphTimeSpans.FirstOrDefault(); this.idleMonitoringTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1) }; this.idleMonitoringTimer.Tick += (sender, args) => { this.IdleTime = this.idleTimeProvider.IdleTime; }; this.controller = controller; this.controller.Connected += (s, e) => { this.IsConnected = true; }; this.controller.Disconnected += (s, e) => { this.IsConnected = false; }; this.controller.Message += (s, e) => { AddMessage(e.Message); }; this.controller.Summary += (s, e) => { UpdateSummaryData(e.Summary); }; this.IsImportantProcessDetected = this.controller.ImportantProcessDetected; this.processCheckTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1) }; this.processCheckTimer.Tick += (s, e) => this.IsImportantProcessDetected = this.controller.ImportantProcessDetected; this.processCheckTimer.Start(); this.ConfigureDesiredMinerStatus(MinerProcessStatus.Running); #if !DEBUG versionService.IsUpdateAvailableAsync(available => this.IsUpdateAvailable = available); #endif } catch (Exception e) { AddMessage(e.Message); #if DEBUG throw; #endif } }
public MiningViewModel(IController controller, IIdleTimeProvider idleTimeProvider, ISummaryDataManager summaryDataManager, IWindowController windowController, IVersionService versionService) { this.InitializeDesignTime(controller, idleTimeProvider, summaryDataManager, windowController, versionService); }
public VersionController() { _versionService = new VersionService(); //_versionService = versionService; }
// creates service definition that can be registered with a server public static ServerServiceDefinition BindService(IVersionService serviceImpl) { return ServerServiceDefinition.CreateBuilder(__ServiceName) .AddMethod(__Method_Version, serviceImpl.Version).Build(); }
public CreateAndReleaseVersionAction(IVersionService versionService) { Argument.IsNotNull(() => versionService); _versionService = versionService; }