/// <summary>
        /// Setup all services used in processing
        /// </summary>
        /// <param name="mock"></param>
        /// <param name="registry"></param>
        private static AutoMock Setup(IoTHubServices registry, out IDiscoveryResultProcessor processor)
        {
            var mock = AutoMock.GetLoose(builder => {
                builder.RegisterType <NewtonSoftJsonConverters>().As <IJsonSerializerConverterProvider>();
                builder.RegisterType <NewtonSoftJsonSerializer>().As <IJsonSerializer>();
                builder.RegisterInstance(registry).As <IIoTHubTwinServices>();
                builder.RegisterType <ApplicationTwins>().As <IApplicationRepository>();
                builder.RegisterType <DiscovererRegistry>().As <IDiscovererRegistry>();
                builder.RegisterType <SupervisorRegistry>().As <ISupervisorRegistry>();
                builder.RegisterType <PublisherRegistry>().As <IPublisherRegistry>();
                builder.RegisterType <GatewayRegistry>().As <IGatewayRegistry>();
                builder.RegisterType <EndpointRegistry>().As <IEndpointBulkProcessor>();
                builder.RegisterType <ApplicationRegistry>().As <IApplicationBulkProcessor>();
            });

            processor = mock.Create <DiscoveryProcessor>();
            return(mock);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Create controller
 /// </summary>
 /// <param name="onboarding"></param>
 public DiscoveryController(IDiscoveryResultProcessor onboarding)
 {
     _onboarding = onboarding;
 }