public WrapperService(IConfigurationService configurationService, IWrapperMap wrapperMap, IAgent agent, IAgentHealthReporter agentHealthReporter, IAgentTimerService agentTimerService) { _configurationService = configurationService; _maxConsecutiveFailures = configurationService.Configuration.WrapperExceptionLimit; _agent = agent; _wrapperMap = wrapperMap; _agentHealthReporter = agentHealthReporter; _agentTimerService = agentTimerService; _functionIdToWrapper = new ConcurrentDictionary <ulong, InstrumentedMethodInfoWrapper>(); }
public void SetUp() { _wrapperMap = Mock.Create <IWrapperMap>(); _agent = Mock.Create <IAgent>(); _configurationService = Mock.Create <IConfigurationService>(); _agentHealthReporter = Mock.Create <IAgentHealthReporter>(); _agentTimerService = Mock.Create <IAgentTimerService>(); Mock.Arrange(() => _configurationService.Configuration.WrapperExceptionLimit).Returns(10); _defaultWrapper = Mock.Create <IDefaultWrapper>(); _noOpWrapper = Mock.Create <INoOpWrapper>(); _transactionRequiredWrapper = Mock.Create <IWrapper>(); Mock.Arrange(() => _transactionRequiredWrapper.IsTransactionRequired).Returns(true); _wrapperService = new WrapperService(_configurationService, _wrapperMap, _agent, _agentHealthReporter, _agentTimerService); }