Ejemplo n.º 1
0
        public void SubscriptionWorkerHelper_ConcurrentSubscriptionsConcurrentFilteredOnly_MultipleFilters_SubscriptionsReturned(String filter)
        {
            List <PersistentSubscriptionInfo> all     = TestData.GetPersistentSubscriptions_DemoEstate();
            List <PersistentSubscriptionInfo> current = new List <PersistentSubscriptionInfo>();

            List <PersistentSubscriptionInfo> actual = SubscriptionWorkerHelper.GetNewSubscriptions(all, current, false, "local-", filter);

            actual.Count.ShouldBe(2);
        }
Ejemplo n.º 2
0
        public void SubscriptionWorkerHelper_OrderedSubscriptionsSelected_SubscriptionsReturned()
        {
            var all     = TestData.GetPersistentSubscriptions_DemoEstate();
            var current = new List <PersistentSubscriptionInfo>();

            var actual = SubscriptionWorkerHelper.GetNewSubscriptions(all, current, true, "local-");

            actual.Count.ShouldBe(3);
        }
Ejemplo n.º 3
0
        public void SubscriptionWorkerHelper_ConcurrentStreamsWithSpecificStreamNameSpecified_SubscriptionsReturned()
        {
            List <PersistentSubscriptionInfo> all     = TestData.GetPersistentSubscriptions_DemoEstate();
            List <PersistentSubscriptionInfo> current = new List <PersistentSubscriptionInfo>();

            List <PersistentSubscriptionInfo> actual = SubscriptionWorkerHelper.GetNewSubscriptions(all, current, false, null, null, "$et-EstateCreatedEvent");

            actual.Count.ShouldBe(1);
        }
Ejemplo n.º 4
0
        public void SubscriptionWorkerHelper_GetNew_SubscriptionsFiltersAsExpected__SubscriptionsReturned(Boolean isOrdered,
                                                                                                          String ignoreSubscriptions,
                                                                                                          String filter,
                                                                                                          String streamName,
                                                                                                          Int32 expected)
        {
            List <PersistentSubscriptionInfo> all     = new();
            List <PersistentSubscriptionInfo> current = new();

            //NOTE: The combinations are ridiculously over complicated, but at the moment I can't think of a better way of achieving this.

            all.Add(new PersistentSubscriptionInfo
            {
                StreamName = "$et-EstateCreatedEvent",
                GroupName  = "local-1"
            });
            all.Add(new PersistentSubscriptionInfo
            {
                StreamName = "DemoEstate",
                GroupName  = "Reporting"
            });
            all.Add(new PersistentSubscriptionInfo
            {
                StreamName = "$et-EstateCreatedEvent",
                GroupName  = "Migrations"
            });
            all.Add(new PersistentSubscriptionInfo
            {
                StreamName = "$et-EstateNameUpdated",
                GroupName  = "Migrations"
            });
            all.Add(new PersistentSubscriptionInfo
            {
                StreamName = "$et-EstateCreated",
                GroupName  = "local-2"
            });

            all.Add(new PersistentSubscriptionInfo
            {
                StreamName = "$projections_ExternalProjections_result_1",
                GroupName  = "Ordered"
            });
            all.Add(new PersistentSubscriptionInfo
            {
                StreamName = "$projections_ExternalProjections_result_2",
                GroupName  = "OrderedX"
            });
            all.Add(new PersistentSubscriptionInfo
            {
                StreamName = "$projections_ExternalProjections_result_3",
                GroupName  = "Ordered"
            });

            var actual = SubscriptionWorkerHelper.GetNewSubscriptions(all, current, isOrdered, ignoreSubscriptions, filter, streamName);

            actual.Count.ShouldBe(expected);
        }
Ejemplo n.º 5
0
        public void SubscriptionWorkerHelper_ConcurrentSubscriptionsSelected_SubscriptionsReturned()
        {
            List <PersistentSubscriptionInfo> all     = TestData.GetPersistentSubscriptions_DemoEstate();
            List <PersistentSubscriptionInfo> current = new List <PersistentSubscriptionInfo>();

            List <PersistentSubscriptionInfo> actual = SubscriptionWorkerHelper.GetNewSubscriptions(all, current, false, "local-");

            actual.Count.ShouldBe(4);
        }
Ejemplo n.º 6
0
        public void SubscriptionWorkerHelper_ConcurrentSubscriptionsIgnoringLocal_SubscriptionsReturned()
        {
            List <PersistentSubscriptionInfo> all     = TestData.GetPersistentSubscriptions_DemoEstate();
            List <PersistentSubscriptionInfo> current = new List <PersistentSubscriptionInfo>();

            all.Add(new PersistentSubscriptionInfo
            {
                StreamName = "Test Stream #1",
                GroupName  = "local-1"
            });

            List <PersistentSubscriptionInfo> actual = SubscriptionWorkerHelper.GetNewSubscriptions(all, current, false, "local-");

            actual.Count.ShouldBe(4);
        }
Ejemplo n.º 7
0
        public void SubscriptionWorkerHelper_OrderedSubscriptionsIgnoringLocalOrdered_SubscriptionsReturned()
        {
            var all     = TestData.GetPersistentSubscriptions_DemoEstate();
            var current = new List <PersistentSubscriptionInfo>();

            all.Add(new PersistentSubscriptionInfo
            {
                StreamName = "Test Stream #1",
                GroupName  = "local-Ordered"
            });

            var actual = SubscriptionWorkerHelper.GetNewSubscriptions(all, current, true, "local-");

            actual.Count.ShouldBe(3);
        }
Ejemplo n.º 8
0
        public void SubscriptionWorkerHelper_GetSubscriptionsMatchingStreamName_SubscriptionsReturned()
        {
            List <PersistentSubscriptionInfo> all = new();
            var current = new List <PersistentSubscriptionInfo>();

            all.Add(new PersistentSubscriptionInfo
            {
                StreamName = "$et-EstateCreatedEvent",
                GroupName  = "local-1"
            });

            all.Add(new PersistentSubscriptionInfo
            {
                StreamName = "$et-SomeEvent",
                GroupName  = "local-1"
            });

            var actual = SubscriptionWorkerHelper.GetNewSubscriptions(all, current, false, null, null, "$et-EstateCreatedEvent");

            actual.Count.ShouldBe(1);
        }
Ejemplo n.º 9
0
        public void SubscriptionWorkerHelper_LocalSubscriptionsLocalConcurrentSelected_WorkerCreated(Boolean isOrdered,
                                                                                                     String ignoreSubscriptions,
                                                                                                     String filter,
                                                                                                     Int32 expected)
        {
            var all     = TestData.GetPersistentSubscriptions_DemoEstate();
            var current = new List <PersistentSubscriptionInfo>();

            all.Add(new PersistentSubscriptionInfo
            {
                StreamName = "Test Stream #1",
                GroupName  = "local-Group1"
            });
            all.Add(new PersistentSubscriptionInfo
            {
                StreamName = "Test Stream #2",
                GroupName  = "local-Group2"
            });
            all.Add(new PersistentSubscriptionInfo
            {
                StreamName = "Test Stream #3",
                GroupName  = "local-Group3"
            });
            all.Add(new PersistentSubscriptionInfo
            {
                StreamName = "Test Stream #4",
                GroupName  = "local-Ordered-Group4"
            });
            all.Add(new PersistentSubscriptionInfo
            {
                StreamName = "Test Stream #5",
                GroupName  = "Ordered-local-Group5"
            });

            var actual = SubscriptionWorkerHelper.GetNewSubscriptions(all, current, isOrdered, ignoreSubscriptions, filter);

            actual.Count.ShouldBe(expected);
        }