Example #1
0
        public CosmosSqlEventBroadcastingScenario(DbFixture cosmosFixture, ServiceBusFixture sbFixture)
        {
            _cosmosFixture = cosmosFixture;
            _sbFixture     = sbFixture;

            _topicName = $"CosmosSqlEventBroadcastingScenario.tests.{Guid.NewGuid()}";
        }
Example #2
0
        public WebJobFixture(IMessageSink messageSink)
            : base(messageSink)
        {
            CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();

            InternalApiIntegrationTestsFixture = new InternalApiIntegrationTestsFixture(this);

            ServiceDiscoveryRegistration.CleanRegisteredServiceFabricServices();
            ServiceDiscoveryRegistration.RegisterFakeServiceEndpoints(InternalApiIntegrationTestsFixture.FakeServer.Ports.First());

            ServiceBusFixture = new ServiceBusFixture(this);
            ServiceBusFixture.Initialize();

            _webJobTestHost = new WebJobTestHost(
                Logger,
                services =>
            {
                services.AddSingleton(ServiceBusFixture);
                services.Replace(new ServiceDescriptor(typeof(IBusSubscriber <>), typeof(TopicSubscriberSelfDestroyingTopicWrapper <>), ServiceLifetime.Singleton));
                services.Replace(new ServiceDescriptor(typeof(IPartnerClientFactory), new FakePartnerClientFactory()));
            }
                );
            _webJobTestHost.Start(cancellationTokenSource.Token);
            SqlConnection = _webJobTestHost.ServiceProvider.GetService <SqlConnection>();

            InternalApiIntegrationTestsFixture.SqlFixture.InitializeAsync().GetAwaiter().GetResult();
        }
        public CosmosMongoSimpleSagaScenario(DbFixture fixture, ServiceBusFixture sbFixture)
        {
            _cosmosFixture = fixture;

            var messageName = nameof(StartSimpleSaga).ToLower();

            _topicName        = $"{messageName}.tests.{Guid.NewGuid()}";
            _subscriptionName = $"{messageName}.workers";
            _sbFixture        = sbFixture;
        }