示例#1
0
 public RetrIocConfiguration(IResolveTypes typeResolver)
 {
     if (typeResolver == null)
     {
         throw new ArgumentNullException("typeResolver");
     }
     TypeResolver = typeResolver;
 }
示例#2
0
        public static string ClientId = bfgCfg.Detect().Id.Split('-').FirstOrDefault(); //get from cfg file if exists

        public bfgWorkerManager(bfgCluster workerCluster, IObservable <StartUnitTest[]> cfg, SystemStatusPublisher systemStatus, IResolveTypes resolver, IRxnManager <IRxn> eventManager, IAppStatusCfg appStatusCfg, IAppServiceRegistry appServiceRegistry, IZipService zipService, IAppStatusStore appCmds, IAppStatusServiceClient appStatus, IAppServiceDiscovery serviceDiscovery, IUpdateServiceClient appUpdates)
        {
            _workerCluster      = workerCluster;
            _cfg                = cfg;
            _resolver           = resolver;
            _eventManager       = eventManager;
            _appStatusCfg       = appStatusCfg;
            _appServiceRegistry = appServiceRegistry;
            _zipService         = zipService;
            _appCmds            = appCmds;
            _appStatus          = appStatus;
            _serviceDiscovery   = serviceDiscovery;
            _appUpdates         = appUpdates;

            systemStatus.Process(new AppStatusInfoProviderEvent()
            {
                ReporterName = nameof(bfgWorkerManager),
                Component    = "Status",
                Info         = WorkerManagerStatus
            }).Until();
        }
示例#3
0
        public T Get <T>()
        {
            ConstructorInfo constructorInfo = FindConstructorFor <T>();

            ParameterInfo[] constructorParams = constructorInfo.GetParameters();
            var             mockParams        = new object[constructorParams.Length];

            for (int i = 0; i < constructorParams.Length; i++)
            {
                Type paramType = constructorParams[i].ParameterType;

                if (_bindings.ContainsKey(paramType))
                {
                    IResolveTypes resolver = _bindings[paramType];
                    mockParams[i] = resolver.Resolve();
                }
                else if (paramType.IsValueType)
                {
                    mockParams[i] = Activator.CreateInstance(paramType);
                }
            }

            return((T)constructorInfo.Invoke(mockParams.ToArray()));
        }
示例#4
0
 public static void ConfigureWith(IResolveTypes binding)
 {
     ConfigVerifier.AssertModuleExists(HttpContext.Current.ApplicationInstance);
     _aspxPageInjector = new AspxPageInjector(new RetrIocConfiguration(binding));
 }
示例#5
0
 public static void ConfigureWith(IResolveTypes binding)
 {
     ConfigVerifier.AssertModuleExists(HttpContext.Current.ApplicationInstance);
     _aspxPageInjector = new AspxPageInjector(new RetrIocConfiguration(binding));
 }
 public RetrIocConfiguration(IResolveTypes typeResolver)
 {
     if (typeResolver == null) throw new ArgumentNullException("typeResolver");
     TypeResolver = typeResolver;
 }
示例#7
0
        public IDisposable LaunchUnitTests(string[] args, IObservable <StartUnitTest[]> allUnitTests, IResolveTypes resolver)
        {
            var stopAutoLaunchingTestsIntoArena = LaunchUnitTestsToTestArenaDelayed(allUnitTests, GetTestarenaUrlFromArgs(args), resolver.Resolve <IAppStatusCfg>()).Until();

            var broadCaste = allUnitTests.FirstAsync()
                             .Do(unitTests => BroadcasteStatsToTestArena(resolver.Resolve <IManageReactors>()))
                             .Until();

            return(new CompositeDisposable(stopAutoLaunchingTestsIntoArena, broadCaste));
        }