public void ErrorTelemetryEventsContainAllDataOnAsyncCall()
        {
            TestTelemetryChannel.Clear();
            var host = new HostingContext <AsyncService, IAsyncService>()
                       .ShouldWaitForCompletion();

            using ( host )
            {
                host.Open();
                IAsyncService client = host.GetChannel();
                try
                {
                    client.FailWithFaultAsync().Wait();
                } catch
                {
                }
            }
            var error = (from item in TestTelemetryChannel.CollectedData()
                         where item is ExceptionTelemetry
                         select item).Cast <ExceptionTelemetry>().First();

            Assert.IsNotNull(error.Exception);
            Assert.IsNotNull(error.Context.Operation.Id);
            Assert.IsNotNull(error.Context.Operation.Name);
        }
        public void ErrorTelemetryEventsAreGeneratedOnAsyncExceptionAndIEDIF_False()
        {
            TestTelemetryChannel.Clear();
            var host = new HostingContext <AsyncService, IAsyncService>()
                       .ShouldWaitForCompletion();

            using (host)
            {
                host.Open();
                IAsyncService client = host.GetChannel();
                try
                {
                    client.FailWithExceptionAsync().Wait();
                }
                catch
                {
                }
            }

            var errors = from item in TestTelemetryChannel.CollectedData()
                         where item is ExceptionTelemetry
                         select item;

            Assert.IsTrue(errors.Count() > 0);
        }
Example #3
0
 public DevelopersService(IDataSource dataSource, IHttpClientFactory httpClientFactory, IOptions <AppSettingsModel> settings)
 {
     _dataSource         = dataSource;
     _settings           = settings.Value;
     _httpClientFactory  = httpClientFactory;
     this.GenericService = new GenericService(dataSource);
 }
Example #4
0
 public PanelService(ICustomerRepository customerRepository,
                     IAccountService accountService,
                     IAsyncService asyncService)
 {
     this.customerRepository = customerRepository;
     this.accountService     = accountService;
     this.asyncService       = asyncService;
 }
Example #5
0
 public CompanyView(IMessageBoxService messageBoxService, IAsyncService asyncService,
                    IDataService <Company> companyDataService)
 {
     _messageBoxService  = messageBoxService;
     _asyncService       = asyncService;
     _companyDataService = companyDataService;
     InitializeComponent();
 }
Example #6
0
        public CompanyView(IMessageBoxService messageBoxService, IAsyncService asyncService,
			IDataService<Company> companyDataService)
        {
            _messageBoxService = messageBoxService;
            _asyncService = asyncService;
            _companyDataService = companyDataService;
            InitializeComponent();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="FileCachingService" /> class.
 /// </summary>
 /// <param name="asyncService">The asynchronous service.</param>
 /// <param name="fileCachingSettingsProvider">The file caching settings provider.</param>
 /// <param name="fileService">The file service.</param>
 public FileCachingService(
     IAsyncService asyncService,
     IFileCachingSettingsProvider fileCachingSettingsProvider,
     IFileService fileService)
 {
     _asyncService = asyncService;
     _fileCachingSettingsProvider = fileCachingSettingsProvider;
     _fileService = fileService;
 }
Example #8
0
        public View3(IMessageBoxService messageBoxService, IAsyncService asyncService,
			IEnumerable<IDataService<Person>> pDataService, IEventAggregator eventAggregator)
        {
            _messageBoxService = messageBoxService;
            _pDataServices = pDataService;
            _eventAggregator = eventAggregator;
            _asyncService = asyncService;
            InitializeComponent();
        }
Example #9
0
 public StarterController(ISingletonService singletonService, IScopedService scopedService, ITransientService transientService, IScopedService secondScopedService, ITransientService secondTransientService, IAsyncService asyncService)
 {
     _singletonService       = singletonService;
     _scopedService          = scopedService;
     _transientService       = transientService;
     _secondScopedService    = secondScopedService;
     _secondTransientService = secondTransientService;
     _asyncService           = asyncService;
 }
Example #10
0
 public View3(IMessageBoxService messageBoxService, IAsyncService asyncService,
              IEnumerable <IDataService <Person> > pDataService, IEventAggregator eventAggregator)
 {
     _messageBoxService = messageBoxService;
     _pDataServices     = pDataService;
     _eventAggregator   = eventAggregator;
     _asyncService      = asyncService;
     InitializeComponent();
 }
Example #11
0
 public CustomerService(ICustomerRepository customerRepository,
                        IFileRepository fileRepository,
                        IAsyncService asyncService,
                        IFileService fileService)
 {
     this.customerRepository = customerRepository;
     this.fileRepository     = fileRepository;
     this.asyncService       = asyncService;
     this.fileService        = fileService;
 }
 public void TelemetryEventsAreGeneratedOnAsyncCall()
 {
     TestTelemetryChannel.Clear();
     using (var host = new HostingContext <AsyncService, IAsyncService>())
     {
         host.Open();
         IAsyncService client = host.GetChannel();
         client.GetDataAsync().Wait();
         Assert.IsTrue(TestTelemetryChannel.CollectedData().Count > 0);
     }
 }
Example #13
0
        public LoadProgressController(LoadProgressViewModel ViewModel, MainMenuViewModel MenuViewModel, IMessenger Messenger, IAsyncService AsyncService, ICommonDataStore CommonDataStore)
        {
            viewModel = ViewModel;

            menuViewModel = MenuViewModel;

            messenger = Messenger;

            asyncService = AsyncService;

            commonDataStore = CommonDataStore;
        }
Example #14
0
        public HexController(HexViewModel ViewModel, MainMenuViewModel MenuViewModel, IMessenger Messenger, IAsyncService AsyncService)
        {
            viewModel     = ViewModel;
            menuViewModel = MenuViewModel;

            viewModel.Title   = "No Display";
            viewModel.HexData = new ObservableCollection <DomainHexData>();

            messenger = Messenger;

            asyncService = AsyncService;
        }
Example #15
0
 public ProjectService(IProjectRepository projectRepository,
                       IAccountService accountService,
                       IAsyncService asyncService,
                       ICustomerRepository customerRepository,
                       IWFFileStateRepository fileStateRepository
                       )
 {
     this.projectRepository   = projectRepository;
     this.accountService      = accountService;
     this.asyncService        = asyncService;
     this.customerRepository  = customerRepository;
     this.fileStateRepository = fileStateRepository;
 }
Example #16
0
    public HexController(HexViewModel ViewModel, MainMenuViewModel MenuViewModel, IMessenger Messenger, IAsyncService AsyncService) {
          viewModel =     ViewModel;
      menuViewModel = MenuViewModel;

      viewModel.Title   = "No Display";
      viewModel.HexData = new ObservableCollection<DomainHexData>();

      messenger = Messenger;

      asyncService = AsyncService;

      registerMessages();
      registerCommands();
    }
Example #17
0
        public MarketsController(MarketsViewModel ViewModel, IAsyncService AsyncService, IMessenger Messenger, IMapper Mapper, IPublicApiService PublicApiService, IPushApiService PushApiService, IUserSettingsRepository SettingsRepository)
        {
            viewModel = ViewModel;

            asyncService = AsyncService;
            messenger    = Messenger;

            mapper = Mapper;

            publicApiService = PublicApiService;

            pushApiService = PushApiService;

            settingsRepository = SettingsRepository;
        }
Example #18
0
        public void TelemetryContextIsFlowedAccrossAsyncCalls()
        {
            TestTelemetryChannel.Clear();
            using (var host = new HostingContext <AsyncService, IAsyncService>())
            {
                host.Open();
                IAsyncService client = host.GetChannel();
                client.WriteDependencyEventAsync().Wait();
            }
            var data    = TestTelemetryChannel.CollectedData();
            var request = data
                          .OfType <RequestTelemetry>()
                          .First();
            var dependency = data
                             .OfType <DependencyTelemetry>()
                             .FirstOrDefault();

            Assert.AreEqual(request.Context.Operation.Id, dependency.Context.Operation.Id);
            Assert.AreEqual(request.Context.Operation.Name, dependency.Context.Operation.Name);
        }
 public FailingBackgroundService(
     ILogger <BackgroundService> logger,
     IDateTime dateTime,
     IAsyncService asyncService) : base(logger, dateTime, asyncService)
 {
 }
Example #20
0
 public AsyncViewModel(IAsyncService asyncService)
 {
     _asyncService = asyncService;
     //_zipCode = "84627";
     _countryCode = "us";
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UnrecognizedOperationTypeCommand"/> class.
 /// </summary>
 /// <param name="asyncService">The asynchronous service.</param>
 /// <param name="config">The configuration.</param>
 public UnrecognizedOperationTypeCommand(IAsyncService asyncService, IOrganizationConfiguration config)
     : base(asyncService, config)
 {
 }
Example #22
0
 public DevelopersController(IAsyncService <Developer> service, IDevelopersService developersService)
 {
     _service           = service;
     _developersService = developersService;
 }
Example #23
0
 internal AsyncOptionWriter(IAsyncService svc)
 {
     _svc = svc;
 }
 public ClientAsyncController(IAsyncService <Client> service)
 {
     this.service = service;
 }
Example #25
0
 public SearchBingAsyncController()
 {
     _asyncService = new AsyncService();
 }
Example #26
0
 public DistributionCommand(IAsyncService asyncService, IOrganizationConfiguration config)
     : base(asyncService, config)
 {
     _distributionTaskService = new EsbDistributionTaskService();
 }
Example #27
0
 public ExtraDurationResponseWriter(
     IAsyncService asyncService)
 {
     _asyncService = asyncService;
 }
Example #28
0
 public BaseController(IAsyncService <TEntity> service)
 {
     this.service = service;
 }
Example #29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AsyncOperationCommand"/> class.
 /// </summary>
 /// <param name="asyncService">The asynchronous service.</param>
 /// <param name="config">The configuration.</param>
 protected AsyncOperationCommand(IAsyncService asyncService, IOrganizationConfiguration config)
 {
     this.AsyncService = asyncService;
     this.Configuration = config;
 }
Example #30
0
 public AsyncJob(IAsyncService asyncService, Control control)
 {
     AsyncService = asyncService;
     Control      = control;
 }
Example #31
0
 /// <summary>
 /// Constructs a <see cref="CleanOldRequestsJob"/> instance.
 /// </summary>
 public CleanOldRequestsJob(ILogger <BackgroundService> logger, IDateTime dateTime, IAsyncService asyncService,
                            IStubContext stubContext) :
     base(logger, dateTime, asyncService)
 {
     _stubContext = stubContext;
 }
Example #32
0
 public ClientFactoryController(IAsyncService <CommentData> clientFactoryService, ILogger <ClientController> logger)
 {
     _clientFactoryService = clientFactoryService;
     _logger = logger;
     _logger.LogInformation($"Executing Controller:{this.GetType().Name}");
 }
Example #33
0
 protected override void OnStart(string[] args)
 {
     _asyncService  = new AsyncService(50000);
     _serviceThread = new Thread(_asyncService.Run);
     _serviceThread.Start();
 }
Example #34
0
 public DevController(IAsyncService service, IDoSomethingService doSomethingService)
 {
     _service            = service;
     _doSomethingService = doSomethingService;
 }
Example #35
0
 public MyCommand(IAsyncService asyncService, IOrganizationConfiguration config)
     : base(asyncService, config)
 {
 }