public virtual void SetUp() { OrganisationService = MockRepository.GenerateMock<IOrganisationService>(); ApplicationRepository = MockRepository.GenerateMock<IApplicationRepository>(); ApiKeyCreator = MockRepository.GenerateMock<IApiKeyCreator>(); ApplicationService = new ApplicationService(ApplicationRepository, OrganisationService, ApiKeyCreator); }
public void SetUp() { TypeRegistry.Instance.Register(typeof(BogusTrackable)); TypeRegistry.Instance.Register(typeof(BogusTrackableChild)); var appService = new ApplicationService(); var host = appService.Host(); }
static void WSStyle() { ApplicationService appService = new ApplicationService(); SslTest.local.hyperion.scottslaptop.ApplicationTypeData[] data = appService.GetApplicationTypes(new SslTest.local.hyperion.scottslaptop.RequestData()); foreach (SslTest.local.hyperion.scottslaptop.ApplicationTypeData d in data) { Console.WriteLine(d.Description); } Console.ReadLine(); }
public void Should_return_null_when_parameters_are_missing_or_invalid(string applicationName, string applicationId) { // Given var applicationService = new ApplicationService(A.Dummy<IRavenSessionProvider>()); // When var application = applicationService.Transfer(applicationName, applicationId); // Then application.ShouldBe(null); }
public async Task RemoveAsync_ShouldReturnError_CommitAsyncFailed() { _characterRepository.Setup(x => x.FindAsync(It.IsAny <Guid>())).ReturnsAsync(Maybe <Character> .Create(CharacterFake())); _uow.Setup(x => x.CommitAsync()).ReturnsAsync(false); var response = await ApplicationService.RemoveAsync(Guid.NewGuid()); response.Should().NotBeNull(); response.HasError.Should().BeTrue(); response.Messages.Should().HaveCount(1); response.Messages.All(message => message.Type.Equals(MessageType.CriticalError)); }
public async Task CreateAsync_ShouldReturnError_AnyCharacterServiceError() { _characterService.Setup(x => x.CreateAsync(It.IsAny <CreateCharacterDto>())).ReturnsAsync(Response <Character> .Create().WithBusinessError("Some error")); var response = await ApplicationService.CreateAsync(CharacterRequestMessageFake()); response.Should().NotBeNull(); response.HasError.Should().BeTrue(); response.Messages.Should().HaveCount(1); response.Data.HasValue.Should().BeFalse(); response.Data.Value.Should().BeNull(); }
public void Should_return_false_when_applicationid_is_missing() { // Given string applicationId = null; var applicationService = new ApplicationService(A.Dummy<IRavenSessionProvider>()); // When var isRegistered = applicationService.IsRegistered(applicationId); // Then isRegistered.ShouldBe(false); }
public ShellViewModel( ResultViewModel resultViewModel, ApplicationService application, JarvisWindowManager windowManager, IEventAggregator inbox) { _application = application; _windowManager = windowManager; Result = resultViewModel; // Subscribe to messages. inbox.Subscribe(this); }
public GamePage(ApplicationService applicationService, NavigationService navigationService, LogHelper logHelper, QuestHelper questHelper, InMemoryContextHelper inMemoryContextHelper) { InitializeComponent(); playerStats = new PlayerStats(); _StatsGoHere.Children.Add(new StatBlock(new StatBlockViewModel(playerStats))); this.Loaded += new RoutedEventHandler(this.Page_Loaded); _applicationService = applicationService; _navigationService = navigationService; LogHelper = logHelper; QuestHelper = questHelper; InMemoryContextHelper = inMemoryContextHelper; }
private async Task ExecuteChangeRoleAsync() { var popup = await ApplicationService.OpenPopup <ChangeRoleWindowVm>(SelectedItem.GetRole()); if (popup.IsValidated) { await HandleMessageBoxError.ExecuteAsync(async() => { await Task.Run(() => ApplicationService.Command <ChangeRole>().Execute(SelectedItem.GetId(), popup.Role)); await LoadCommand.ExecuteAsync(); }); } }
public new virtual void SetUp() { base.SetUp(); FormsAuthenticationService.GetLoggedInOrganisationId().Returns(OrganisationId); ApplicationServiceAgent.GetByOrganisation(OrganisationId) .Returns(new List <Application> { new Application { Id = ApplicationId } }); ApplicationService.GetById(ApplicationId); }
public void Before() { var liteDatabase = new LiteDatabase("Filename=IntegrationTests.db"); foreach (var collectionName in liteDatabase.GetCollectionNames()) { liteDatabase.DropCollection(collectionName); } _liteDbContext = new LiteDbContext(liteDatabase); _applicationService = new ApplicationService(_liteDbContext); }
private async Task ExecuteChangePasswordAsync() { var popup = await ApplicationService.OpenPopup <ChangePasswordWindowVm>(); if (popup.IsValidated) { await HandleMessageBoxError.ExecuteAsync(async() => { await Task.Run(() => ApplicationService.Command <ChangePassword>().Execute(SelectedItem.GetId(), popup.Password1)); MessageBox.Show("Le mot de passe a été changé avec succès !", "Mot de passe changé", MessageBoxButton.OK, MessageBoxImage.Information); }); } }
private object TryGetDefaultPropertyValue(ApplicationService app, object value) { if (value != null && (value.GetType().ImplementsInterface <IEntity>() || value.GetType().ImplementsInterface <IQuery>())) { var valueEntity = app.GetDefaultProperty(value.GetUnproxiedType().FullName); if (!string.IsNullOrWhiteSpace(valueEntity)) { return(TryGetDefaultPropertyValue(app, value.GetType().GetProperty(valueEntity).GetValue(value))); } } return(value); }
/// <summary> /// Get the value of a property. /// </summary> /// <param name="app">The application service.</param> /// <param name="propertyName">The property name.</param> /// <returns>Returns the property value.</returns> public object GetCellValue(ApplicationService app, string propertyName) { if (!string.IsNullOrWhiteSpace(propertyName) && (Columns?.Length ?? 0) > 0) { var column = Array.Find(Columns, x => x.PropertyName == propertyName); if (column != null) { return(GetCellValue(app, column)); } } return(null); }
public void Should_return_null_when_application_name_is_missing() { // Given var name = string.Empty; var applicationService = new ApplicationService(A.Dummy <IRavenSessionProvider>()); // When var application = applicationService.Register(name); // Then application.ShouldBe(null); }
public void Should_return_false_when_applicationid_is_missing() { // Given string applicationId = null; var applicationService = new ApplicationService(A.Dummy <IRavenSessionProvider>()); // When var isRegistered = applicationService.IsRegistered(applicationId); // Then isRegistered.ShouldBe(false); }
public void Should_return_null_when_application_name_is_missing() { // Given var name = string.Empty; var applicationService = new ApplicationService(A.Dummy<IRavenSessionProvider>()); // When var application = applicationService.Register(name); // Then application.ShouldBe(null); }
public async Task UpdateAsync_ShouldReturnSuccess_WithValidArguments() { _characterService.Setup(x => x.UpdateAsync(It.IsAny <UpdateCharacterDto>())).ReturnsAsync(Response <Character> .Create(CharacterFake())); var response = await ApplicationService.UpdateAsync(Guid.NewGuid(), CharacterRequestMessageFake()); response.Should().NotBeNull(); response.HasError.Should().BeFalse(); response.Messages.Should().BeEmpty(); response.Data.HasValue.Should().BeTrue(); response.Data.Value.Should().BeOfType(typeof(CharacterResponseMessage)); }
protected override void OnStartup(StartupEventArgs e) { LogHelper logHelper = new LogHelper(); ApplicationService applicationService = new ApplicationService(logHelper); QuestHelper questHelper = new QuestHelper(); InMemoryContextHelper inMemoryContextHelper = new InMemoryContextHelper(); MainWindow window = new MainWindow(applicationService, new NavigationService(applicationService, logHelper, questHelper, inMemoryContextHelper)); window.Show(); base.OnStartup(e); logHelper.logger.Info("Program started"); }
private void OpenInvokeTab() { var provider = FindProvider(_contextMenuNode); var verb = (Verb)_contextMenuNode.Tag; if (verb.Arguments.Count == 0) { verb.Arguments.AddRange(provider.GetVerbArguments(verb)); } ApplicationService.OpenInvokeTab(string.Format("{0} - Invoke {1}.{2}", provider.ConnectionInfo.Title, verb.EntityName, verb.Name), provider.ConnectionInfo, verb); }
public new virtual void SetUp() { base.SetUp(); LabelCollectionRetriever.Get("ApplicationPage").Returns(_labelsFromRetreiever); _applicationFromService = new Application { Id = ValidApplicationId }; CollectionService.GetByApplication(ValidApplicationId).Returns(_collectionsFromService); ApplicationService.GetById(ValidApplicationId) .Returns(_applicationFromService); _result = ApplicationViewModelGetter.Get(ValidApplicationId); }
public static void Main(string[] args) { Log.Logger = new LoggerConfiguration() .MinimumLevel.Information() .WriteTo.File("log-.txt", rollOnFileSizeLimit: true, shared: true, flushToDiskInterval: TimeSpan.FromSeconds(1)) .CreateLogger(); Log.Information("Start Geonorge - nedlaster"); Console.WriteLine("Geonorge - nedlaster"); Console.WriteLine("--------------------"); var appSettings = ApplicationService.GetAppSettings(); if (args.Any()) { Log.Debug("Selected config file(s): "); foreach (var configName in args) { Log.Debug(configName); } foreach (var configName in args) { Log.Debug("Download from selected config-file: " + configName); var config = appSettings.GetConfigByName(configName); if (config != null) { DeleteOldLogs(config.LogDirectory); StartDownloadAsync(config).Wait(); } else { Log.Error("Could not find config file: " + configName); Console.WriteLine("Error: Could not find config file: " + configName); } } } else { Log.Debug("No config file is selected. Download from all config-files"); var datasetService = new DatasetService(appSettings.LastOpendConfigFile); datasetService.ConvertDownloadToDefaultConfigFileIfExists(); foreach (var config in appSettings.ConfigFiles) { StartDownloadAsync(config).Wait(); } } }
private bool TrySavePolicies() { if (_isDataUpToDate.GetValueOrDefault(false)) { PolicyDataService.Save(_insurancePolicies.Select(s => s.InsurancePolicy).ToList()); return(true); } else { ApplicationService.Alert("You must refresh before you can save."); return(false); } }
public object Get([FromQuery(Name = "sort")] string sort) { var applicationsDb = _context.Applications; if (applicationsDb.IsNullOrEmpty()) { return(StatusCode(204)); } var applications = ApplicationService.GetApplications(_context.Applications); return(sort == "desc"? (object)applications.OrderByDescending(t => t.Id): applications); }
public async Task GetCharacterAsync_ShouldReturnSuccess_CharacterFound() { _characterRepository.Setup(x => x.FindAsNoTrackingAsync(It.IsAny <Guid>())).ReturnsAsync(CharacterFake()); var response = await ApplicationService.GetCharacterAsync(Guid.NewGuid()); response.Should().NotBeNull(); response.HasError.Should().BeFalse(); response.Messages.Should().BeEmpty(); response.Data.HasValue.Should().BeTrue(); response.Data.Value.Should().BeOfType(typeof(CharacterResponseMessage)); response.Data.Value.Name.Should().Be(CharacterFake().Name); }
public async Task Can_Calculate_Total_Events_By_Region() { // Arrange var service = new ApplicationService(_mock.Object, _tagRepositoryMock.Object, _mapper); // Act var target = await service.GetTagEventByRegion("nordeste"); // Assert Assert.AreEqual(target.Country, "brasil"); Assert.AreEqual(target.Region, "nordeste"); Assert.AreEqual(target.Total, 1); }
public void GetApplicationByTitleEmail_Fail_NullValuesReturnNull() { using (var _db = tu.CreateDataBaseContext()) { IApplicationService _applicationService = new ApplicationService(_db);; // Act var result = _applicationService.GetApplication(null, null); // Assert Assert.IsNull(result); } }
/// <summary> /// 自动安装群组的相关应用 /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> private void InstallApplicationsModule_After(GroupEntity sender, CommonEventArgs eventArgs) { ApplicationService applicationService = new ApplicationService(); if (eventArgs.EventOperationType == EventOperationType.Instance().Create()) { applicationService.InstallApplicationsOfPresentAreaOwner(PresentAreaKeysOfBuiltIn.GroupSpace, sender.GroupId); } else if (eventArgs.EventOperationType == EventOperationType.Instance().Delete()) { applicationService.DeleteApplicationsOfPresentAreaOwner(PresentAreaKeysOfBuiltIn.GroupSpace, sender.GroupId); } }
protected override void OnStartup(StartupEventArgs e) { var service = new ApplicationService(); service .Register <MainViewModel, MainWindow>() .Register <SecondWindowViewModel, SecondWindow>() .Register <TestDialogViewModel, TestDialog>() .Register <ParameterViewModel, ParameterWindow>() .OpenWindow <MainViewModel>(); base.OnStartup(e); }
public async void StartService(ApplicationService service) { IsBusy = true; var startServiceTask = Task.Factory.StartNew(() => _statusMonitorService.StartService(service.ServerName, service.ServiceName)); await startServiceTask.ContinueWith(e => { IsBusy = false; SelectedService.Status = e.Result; SelectedService.Image = GetImageSource(SelectedService.Status); }); RaiseContextMenuCanExceute(); }
public ApplicationController(ICommonDataService dataService, IConfiguration configuration, ISearchFilterSettingsService searchFilterSettingsService, IEntityStateHelper entityStateHelper, ImlApplicationService imlApplicationService, ApplicationService <ImlApplication> applicationService, IAtuAddressService atuAddressService, BackOfficeUserService backOfficeUserService, ImlApplicationProcessService imlApplicationProcessService, IImlLicenseService imlLicenseService, IConverter converter, ImlApplicationService imlAppService) : base(dataService, configuration, searchFilterSettingsService) { _configuration = configuration; _entityStateHelper = entityStateHelper; _imlApplicationService = imlApplicationService; _applicationService = applicationService; _atuAddressService = atuAddressService; _backOfficeUserService = backOfficeUserService; _imlApplicationProcessService = imlApplicationProcessService; _imlLicenseService = imlLicenseService; _converter = converter; _imlAppService = imlAppService; }
public PrlApplicationService(ICommonDataService dataService, IUserInfoService userInfoService, IPrlReportService prlReportService, IObjectMapper objectMapper, IConverter converter, IPrlLicenseService prlLicenseService, PrlApplicationProcessService applicationProcessService, LimsExchangeService limsExchangeService, ApplicationService <PrlApplication> applicationService) { DataService = dataService; _userInfoService = userInfoService; _objectMapper = objectMapper; _prlReportService = prlReportService; _converter = converter; _prlLicenseService = prlLicenseService; _limsExchangeService = limsExchangeService; _applicationService = applicationService; }
public SupplierController( ApplicationService service, EngineView engineView, TyreView tyreView, FuelView fuelView, IMapperService mapper) { _service = service ?? throw new ArgumentNullException(nameof(service)); _engineView = engineView ?? throw new ArgumentNullException(nameof(engineView)); _tyreView = tyreView ?? throw new ArgumentNullException(nameof(tyreView)); _fuelView = fuelView ?? throw new ArgumentNullException(nameof(fuelView)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); }
private ItemManager() { client = new MobileServiceClient(Constants.ServiceURL); LocalStore = new MobileServiceSQLiteStore(Constants.LocalDbName); applicationservice = new ApplicationService(); LocalStore.DefineTable <E_Shop_Xamarin.Models.Image>(); LocalStore.DefineTable <Item>(); LocalStore.DefineTable <Cart>(); client.SyncContext.InitializeAsync(LocalStore); imageTable = client.GetSyncTable <E_Shop_Xamarin.Models.Image>(); itemTable = client.GetSyncTable <Item>(); cartTable = client.GetSyncTable <Cart>(); }
public async Task <IActionResult> AddOrUpdateAsync([FromBody] AddConfigDto addConfigDto) { if (!ModelState.IsValid) { return(this.ValidationError()); } Application app = this.GetApplication(); ApplicationService serv = this.GetService(); ServiceEnvironment env = this.GetEnvironment(); await _client.AddConfigAsync(app.Key, serv.Key, env.Key, addConfigDto.ConfigName, addConfigDto.ConfigValue); return(Ok()); }
public void Should_return_true_when_applicationid_is_known() { // Given var applicationId = MakeFake.Guid; var instanceToLoad = new Application(); var fakeRavenSessionProvider = MakeFake.RavenSessionProvider<Application>(instanceToLoad); var applicationService = new ApplicationService(fakeRavenSessionProvider); // When var isRegistered = applicationService.IsRegistered(applicationId); // Then isRegistered.ShouldBe(true); }
public ApplicationServicesTest() { _applicationService = new ApplicationService(_ctx); _ctx.Applications.Add(new Domain.Application() { ApiKey = new Guid("bda11d91-7ade-4da1-855d-24adfe39d174"), ApplicationName = "Test Application", IsActive = true, Url = "http://www.test.com" }); _ctx.SaveChanges(); }
public void Should_return_new_Application_when_new_application_is_registered() { // Given var applicationName = MakeFake.Name; var instanceToLoad = new Application() { Name = applicationName}; var fakeRavenSessionProvider = MakeFake.RavenSessionProvider<Application>(instanceToLoad); var applicationService = new ApplicationService(fakeRavenSessionProvider); // When var application = applicationService.Register(applicationName); // Then application.Name.ShouldBe(applicationName); application.Id.IsGuid().ShouldBe(true); }
public void Should_return_new_Application_when_application_is_registered_with_existing_applicationid() { // Given var applicationName = MakeFake.Name; var applicationId = MakeFake.Guid; var instanceToLoad = new Application() { Id = applicationId, Name = applicationName }; var fakeRavenSessionProvider = MakeFake.RavenSessionProvider<Application>(instanceToLoad); var applicationService = new ApplicationService(fakeRavenSessionProvider); // When var application = applicationService.Transfer(applicationName, applicationId); // Then application.Name.ShouldBe(applicationName); application.Id.ShouldBe(applicationId); }
public void Should_return_application_when_known_applicationid_is_supplied() { // Given var applicationId = MakeFake.Guid; var applicationName = MakeFake.Name; var instanceToLoad = new Application() { Id = applicationId, Name = applicationName }; var fakeRavenSessionProvider = MakeFake.RavenSessionProvider<Application>(instanceToLoad); var applicationService = new ApplicationService(fakeRavenSessionProvider); // When var application = applicationService.Get(applicationId); // Then application.Name.ShouldBe(applicationName); application.Id.ShouldBe(applicationId); }
public void WhenAddingToEmailLogEmalLogIsAdded() { _emailLogService = new EmailLogService(_ctx); _applicationService = new ApplicationService(_ctx); var application = _applicationService.AddApplication("Test", "http://www.test.com", true); string fromAddress = "*****@*****.**"; string toAddress = "*****@*****.**"; string subject = "Test Email"; string body = "Welcome to PaidThx"; Nullable<DateTime> sentDate = System.DateTime.Now; EmailLog expected = _emailLogService.AddEmailLog(application.ApiKey, fromAddress, toAddress, subject, body, sentDate); EmailLog actual = _ctx.EmailLog.ElementAt(0); Assert.AreEqual(expected, actual); }
public static AppAddresss ConvertServiceAddressToAppAddress(ApplicationService.address serviceAddress) { AppAddresss tempaddress = new AppAddresss(); tempaddress.id = serviceAddress.addressid; tempaddress.objectid = serviceAddress.objectid; tempaddress.companyid = serviceAddress.creatorid; tempaddress.line1 = serviceAddress.addressline1; tempaddress.line2 = serviceAddress.addressline2; tempaddress.landmark = serviceAddress.landmark; tempaddress.city = serviceAddress.city; tempaddress.state = serviceAddress.state; tempaddress.country = serviceAddress.country; tempaddress.zipcode = serviceAddress.zipcode; tempaddress.objecttype = serviceAddress.objecttype; return tempaddress; }
public static AppCustomer ConvertServiceCustomerToAppCustomer(ApplicationService.customer serviceCustomer) { AppCustomer tempcustomer = new AppCustomer(); tempcustomer.id = serviceCustomer.customerid; tempcustomer.name = serviceCustomer.name; tempcustomer.email = serviceCustomer.email; tempcustomer.companyid = serviceCustomer.companyid; tempcustomer.status = serviceCustomer.status; tempcustomer.data = serviceCustomer.data; tempcustomer.objectid = serviceCustomer.objectid; tempcustomer.createdby = serviceCustomer.createdby; tempcustomer.createdon = serviceCustomer.createddate; tempcustomer.modifiedby = serviceCustomer.modifiedby; tempcustomer.modifiedon = serviceCustomer.modifieddate; return tempcustomer; }
private void button8_Click(object sender, EventArgs e) { PASATCore.ApplicationService a = new ApplicationService(); XMLResult r= a.listApplications(); }
public static AppContact ConvertServiceContactToAppContact(ApplicationService.contact servicecontact) { AppContact tempContact = new AppContact(); tempContact.id = servicecontact.contactid; tempContact.objectid = servicecontact.objectid; tempContact.Title = servicecontact.title; tempContact.FirstName = servicecontact.firstname; tempContact.LastName = servicecontact.lastname; tempContact.email = servicecontact.emailid; tempContact.secondaryemail = servicecontact.secondaryemail; tempContact.phone = servicecontact.phone; tempContact.mobile = servicecontact.mobile; tempContact.type = servicecontact.type; tempContact.objecttype = servicecontact.objecttype; tempContact.data = servicecontact.data; tempContact.createdby = servicecontact.createdby; tempContact.createdon = servicecontact.createddate; tempContact.creatorid = servicecontact.creatorid; tempContact.modifiedby = servicecontact.modifiedby; tempContact.modifiedon = servicecontact.modifieddate; return tempContact; }
public void SetUp() { mockRepo = new Mock<IRepository<Application>>(); testService = new ApplicationService(mockRepo.Object); }
public static AppComment ConvertServiceAddressToAppComment(ApplicationService.AppNotes serviceComments) { AppComment comment = new AppComment(); comment.id = serviceComments.id; comment.subjectid = serviceComments.subjectid; comment.subjecttype = serviceComments.subjecttype; comment.parentid = serviceComments.parentid; comment.type = serviceComments.type; comment.objecttype = serviceComments.objecttype; comment.status = serviceComments.status; comment.des = serviceComments.des; comment.ownerid = serviceComments.ownerid; comment.appid = serviceComments.appid; comment.networkid = serviceComments.networkid; comment.modifiedby = serviceComments.modifiedby; comment.modifieddate = serviceComments.modifieddate; return comment; }