public void Correctly_executes_service_agents() { MockRepository mocks = new MockRepository(); IApplicationSettings settings = mocks.CreateMock<IApplicationSettings>(); ITypeActivator activator = mocks.CreateMock<ITypeActivator>(); IServiceAgentFactory factory = mocks.CreateMock<IServiceAgentFactory>(); IServiceAgent serviceAgent1 = mocks.CreateMock<IServiceAgent>(); IServiceAgent serviceAgent2 = mocks.CreateMock<IServiceAgent>(); IServiceAgent[] serviceAgents = new IServiceAgent[] { serviceAgent1, serviceAgent2 }; IServiceAgentAggregator aggregator = new ServiceAgentAggregator(settings, activator); using (mocks.Record()) { Expect.Call(settings.GetServiceAgentFactory()).Return("serviceAgentType"); Expect.Call(activator.ActivateType<IServiceAgentFactory>("serviceAgentType")).Return(factory); Expect.Call(factory.GetServiceAgents()).Return(serviceAgents); Expect.Call(serviceAgent1.AgentName).Return("FirstAgent").Repeat.Any(); serviceAgent1.Run(); Expect.Call(serviceAgent2.AgentName).Return("SecondAgent").Repeat.Any(); serviceAgent2.Run(); } using (mocks.Playback()) { aggregator.ExecuteServiceAgentCycle(); } mocks.VerifyAll(); }
public DataExtractServiceProcessor() { LogWrapper.Log("Enter DataExtractServiceProcess .ctor", $"Thread id : {System.Threading.Thread.CurrentThread.ManagedThreadId}", 1, System.Diagnostics.TraceEventType.Information); _dal = new DataAccessImpl(); _serviceProxy = new ExternalServiceAgent(); LogWrapper.Log("Exit DataExtractServiceProcess .ctor", $"Thread id : {System.Threading.Thread.CurrentThread.ManagedThreadId}", 1, System.Diagnostics.TraceEventType.Information); }
public void Correctly_executes_service_agents() { MockRepository mocks = new MockRepository(); IApplicationSettings settings = mocks.CreateMock <IApplicationSettings>(); ITypeActivator activator = mocks.CreateMock <ITypeActivator>(); IServiceAgentFactory factory = mocks.CreateMock <IServiceAgentFactory>(); IServiceAgent serviceAgent1 = mocks.CreateMock <IServiceAgent>(); IServiceAgent serviceAgent2 = mocks.CreateMock <IServiceAgent>(); IServiceAgent[] serviceAgents = new IServiceAgent[] { serviceAgent1, serviceAgent2 }; IServiceAgentAggregator aggregator = new ServiceAgentAggregator(settings, activator); using (mocks.Record()) { Expect.Call(settings.GetServiceAgentFactory()).Return("serviceAgentType"); Expect.Call(activator.ActivateType <IServiceAgentFactory>("serviceAgentType")).Return(factory); Expect.Call(factory.GetServiceAgents()).Return(serviceAgents); Expect.Call(serviceAgent1.AgentName).Return("FirstAgent").Repeat.Any(); serviceAgent1.Run(); Expect.Call(serviceAgent2.AgentName).Return("SecondAgent").Repeat.Any(); serviceAgent2.Run(); } using (mocks.Playback()) { aggregator.ExecuteServiceAgentCycle(); } mocks.VerifyAll(); }
public BaseViewModel() { _closePopupCommand = new DelegateCommand <object>(ClosePopup, CanClose); _dialog = new DialogService(); _dialog.Width = 300; _dialog.Height = 200; this._ServiceAgent = new ServiceAgent(); }
public BaseViewModel() { _closePopupCommand = new DelegateCommand<object>(ClosePopup, CanClose); _dialog = new DialogService(); _dialog.Width = 300; _dialog.Height = 200; this._ServiceAgent = new ServiceAgent(); }
public SecureService( IConfiguration Configuration, IServerUrls ServerUrls, IServiceAgent ServiceAgent) : base(Configuration, ServiceAgent) { serverUrls = ServerUrls; }
public void TestCase() { generator.ProxyBuilder.CreateInterfaceProxyTypeWithTarget( typeof(IPresentationHost), Type.EmptyTypes, typeof(PresentationHost), ProxyGenerationOptions.Default); IServiceAgent agent = (IServiceAgent) generator.CreateInterfaceProxyWithTarget <IServiceAgent>(new ServiceAgent(), new StandardInterceptor()); agent.GetProxy <string>(); }
public MoviesViewModel([Import] IServiceAgent serviceAgent) { //_serviceAgent = !IsInDesignMode ? serviceAgent : new MockServiceAgent(); _serviceAgent = serviceAgent; GetMovieCommand = new RelayCommand<SelectionChangedEventArgs>(GetMovie); GetMovieUrlsCommand = new RelayCommand(GetMovieUrls); NewMovieCommand = new RelayCommand(NewMovie, () => SelMovie == null); UpdMovieCommand = new RelayCommand(UpdMovie, () => SelMovie != null); DelMovieCommand = new RelayCommand(DelMovie, () => SelMovie != null); RefreshCommand = new RelayCommand(Refresh); }
public MoviesViewModel([Import] IServiceAgent serviceAgent) { //_serviceAgent = !IsInDesignMode ? serviceAgent : new MockServiceAgent(); _serviceAgent = serviceAgent; GetMovieCommand = new RelayCommand <SelectionChangedEventArgs>(GetMovie); GetMovieUrlsCommand = new RelayCommand(GetMovieUrls); NewMovieCommand = new RelayCommand(NewMovie, () => SelMovie == null); UpdMovieCommand = new RelayCommand(UpdMovie, () => SelMovie != null); DelMovieCommand = new RelayCommand(DelMovie, () => SelMovie != null); RefreshCommand = new RelayCommand(Refresh); }
/// <summary> /// Costruttore. /// </summary> public SportsViewModel(IServiceAgent srvAgn) { if (IsInDesignMode) { // TODO Fare injection con IDataService SportsData sd = new SportsData(); listCalcio = new ObservableCollection <Calcio>(sd.ListCalcio); listBasket = new ObservableCollection <Basket>(sd.ListBasket); listTennis = new ObservableCollection <Tennis>(sd.ListTennis); } else { // RELAY COMMAND NavToPageCommand = new RelayCommand(IncontroSelectedCommand); // SERVICE AGENT this.serviceAgent = srvAgn; this.serviceAgent.GetSports((sports, err) => { if (err != null) { System.Diagnostics.Debug.WriteLine("[SPORTSVIEWMODEL] \r" + err.Message); } else if (sports != null) { // CALCIO this.ListCalcio = new ObservableCollection <Calcio>(sports.Calcio); RaisePropertyChanged(() => GroupedCalcio); // TENNIS this.listTennis = new ObservableCollection <Tennis>(sports.Tennis); RaisePropertyChanged(() => GroupedTennis); // BASKET this.listBasket = new ObservableCollection <Basket>(sports.Basket); RaisePropertyChanged(() => GroupedBasket); } // Nascondo la progress IsProgressIndicatorVisible = false; } , Constants.URL_JSON); } }
public static AgentControlTask Start(IApplicationContext C, IServiceAgent Agent) { var systemTask = task(() => { try { Agent.Start(); } catch (Exception e) { var message = AppMessage.Error(e); C.Notify(message); return(message); } return(inform("Complete")); }); return(new AgentControlTask(C, Agent, systemTask)); }
public void Should_continue_with_next_agents_event_if_one_agent_fails() { ApplicationException exception = new ApplicationException("Test Exception"); MockRepository mocks = new MockRepository(); IApplicationSettings settings = mocks.CreateMock<IApplicationSettings>(); ITypeActivator activator = mocks.CreateMock<ITypeActivator>(); IServiceAgentFactory factory = mocks.CreateMock<IServiceAgentFactory>(); IServiceAgent serviceAgent1 = mocks.CreateMock<IServiceAgent>(); IServiceAgent serviceAgent2 = mocks.CreateMock<IServiceAgent>(); IServiceAgent[] serviceAgents = new IServiceAgent[] { serviceAgent1, serviceAgent2 }; IServiceAgentAggregator aggregator = new ServiceAgentAggregator(settings, activator); using (mocks.Record()) { Expect.Call(settings.GetServiceAgentFactory()).Return("serviceAgentType"); Expect.Call(activator.ActivateType<IServiceAgentFactory>("serviceAgentType")).Return(factory); Expect.Call(factory.GetServiceAgents()).Return(serviceAgents); Expect.Call(serviceAgent1.AgentName).Return("FirstAgent").Repeat.Any(); serviceAgent1.Run(); LastCall.On(serviceAgent1).Throw(exception); Expect.Call(serviceAgent2.AgentName).Return("SecondAgent").Repeat.Any(); serviceAgent2.Run(); } using (mocks.Playback()) { aggregator.ExecuteServiceAgentCycle(); } mocks.VerifyAll(); }
public void Should_continue_with_next_agents_event_if_one_agent_fails() { ApplicationException exception = new ApplicationException("Test Exception"); MockRepository mocks = new MockRepository(); IApplicationSettings settings = mocks.CreateMock <IApplicationSettings>(); ITypeActivator activator = mocks.CreateMock <ITypeActivator>(); IServiceAgentFactory factory = mocks.CreateMock <IServiceAgentFactory>(); IServiceAgent serviceAgent1 = mocks.CreateMock <IServiceAgent>(); IServiceAgent serviceAgent2 = mocks.CreateMock <IServiceAgent>(); IServiceAgent[] serviceAgents = new IServiceAgent[] { serviceAgent1, serviceAgent2 }; IServiceAgentAggregator aggregator = new ServiceAgentAggregator(settings, activator); using (mocks.Record()) { Expect.Call(settings.GetServiceAgentFactory()).Return("serviceAgentType"); Expect.Call(activator.ActivateType <IServiceAgentFactory>("serviceAgentType")).Return(factory); Expect.Call(factory.GetServiceAgents()).Return(serviceAgents); Expect.Call(serviceAgent1.AgentName).Return("FirstAgent").Repeat.Any(); serviceAgent1.Run(); LastCall.On(serviceAgent1).Throw(exception); Expect.Call(serviceAgent2.AgentName).Return("SecondAgent").Repeat.Any(); serviceAgent2.Run(); } using (mocks.Playback()) { aggregator.ExecuteServiceAgentCycle(); } mocks.VerifyAll(); }
public PatientController() { objPatientRepository = new ServiceAgent(); }
public SupplierController(IServiceAgent serviceAgent, ITransactionIndexerServiceAgent txAgent, IBusinessLogicLayer businessLayer) { _businessLogicLayer = businessLayer; _service = serviceAgent; _txAgent = txAgent; }
/// <summary> /// Determines the identiy of an agent /// </summary> /// <param name="agent">The agent</param> public static AgentIdentity Identity(this IServiceAgent agent) => (agent.ServerId, agent.AgentId);
// TODO: ctor that accepts IXxxServiceAgent public GaeldsposterViewModel(IServiceAgent serviceAgent) { this.serviceAgent = serviceAgent; }
// TODO: ctor that accepts IXxxServiceAgent public KreditorSkylderListViewModel(IServiceAgent serviceAgent) { this.serviceAgent = serviceAgent; }
public CounterService( IConfiguration Configuration, IServiceAgent ServiceAgent) : base(Configuration, ServiceAgent) { }
public PeopleViewModel(IServiceAgent serviceAgent) { this.Birthdate = DateTime.Now; this._serviceAgent = serviceAgent; }
public OrderController(IServiceAgent serviceAgent, ITransactionIndexerServiceAgent txAgent) { _service = serviceAgent; _txAgent = txAgent; }
public void Register(IServiceAgent agent) { Agents.TryAdd(agent.Identity(), agent); }
public ProductsViewModel(IServiceAgent serviceAgent) { this._serviceAgent = serviceAgent; }
public HomeController(IServiceAgent serviceAgent) { _serviceAgent = serviceAgent; }
public AgentController(IServiceAgent serviceAgent, IServiceSeance serviceSeance, IMapper mapper) { this.serviceSeance = serviceSeance; this.mapper = mapper; this.serviceAgent = serviceAgent; }
public MyPresenter(IServiceAgent services) {
public ExceuteSA(IServiceAgent <CommonServiceAgent> serviceAgent) { _serviceAgent = serviceAgent; }
public AuthController(IMapper mapper, IServiceAgent serviceAgent, IServiceAuthentification serviceAuthentification) { this.serviceAuthentification = serviceAuthentification; this.serviceAgent = serviceAgent; this.mapper = mapper; }
public CustomersViewModel(IServiceAgent serviceAgent) { this._serviceAgent = serviceAgent; }
public GuestBookController(IServiceAgent agent) { this.agent = agent; }
public AgentControlTask(IApplicationContext C, IServiceAgent ControlledAgent, Task <IAppMessage> SystemTask) : base(C) { this.ControlledAgent = ControlledAgent; this.SystemTask = SystemTask; }
public BaseService(IConfiguration Configuration, IServiceAgent ServiceAgent) { configuration = Configuration; agent = ServiceAgent; }
public RedirectController(IServiceAgent serviceAgent) { _serviceAgent = serviceAgent; }// GET: /<controller>/
IServiceAgent _sa; // custom made service agent for accessing some other web service public Foo(IExceptionManager em, IDatabase db, IServiceAgent _sa) { _em = em; _db = db; _sa = sa; }