Exemple #1
0
        public void RegisterQueueName_Two_Equal_Names_SecondCallMustReturnFalse()
        {
            //prepare
            OnlyOnceRegistrationSubscriberController onlyOnceRegistrationSubscriberController =
                new OnlyOnceRegistrationSubscriberController();

            //act
            bool sharingruleshandlerNameRegistration = onlyOnceRegistrationSubscriberController
                                                       .RegisterSubscriberName("identity.sharingruleshandler", out IDisposable firstSharingruleshandlerNameHandle);
            bool duplicateNameRegistration = onlyOnceRegistrationSubscriberController
                                             .RegisterSubscriberName("identity.sharingruleshandler", out IDisposable secondSharingruleshandlerNameHandle);

            //check
            sharingruleshandlerNameRegistration.Should().BeTrue();
            duplicateNameRegistration.Should().BeFalse();
            firstSharingruleshandlerNameHandle.Should().NotBeNull();
            secondSharingruleshandlerNameHandle.Should().BeNull();
        }
Exemple #2
0
        public void RegisterQueueName_Two_Different_Names_BothNamesShouldBeRegistered()
        {
            //prepare
            OnlyOnceRegistrationSubscriberController onlyOnceRegistrationSubscriberController =
                new OnlyOnceRegistrationSubscriberController();

            //act
            bool sharingruleshandlerNameRegistration = onlyOnceRegistrationSubscriberController
                                                       .RegisterSubscriberName("identity.sharingruleshandler", out IDisposable sharingruleshandlerNameHandle);
            bool assoicationlogicNameRegistration = onlyOnceRegistrationSubscriberController
                                                    .RegisterSubscriberName("crm.assoicationlogic", out IDisposable assoicationlogicNameHandle);

            //check
            sharingruleshandlerNameRegistration.Should().BeTrue();
            assoicationlogicNameRegistration.Should().BeTrue();
            sharingruleshandlerNameHandle.Should().NotBeNull();
            assoicationlogicNameHandle.Should().NotBeNull();
            sharingruleshandlerNameHandle.Should().NotBe(assoicationlogicNameHandle);
        }
Exemple #3
0
        public void RegisterQueueName_Two_Equal_Names_with_Dispose_In_the_Middle_ReRegistrationMustBeSucccesful()
        {
            //prepare
            OnlyOnceRegistrationSubscriberController onlyOnceRegistrationSubscriberController =
                new OnlyOnceRegistrationSubscriberController();

            //act
            bool sharingruleshandlerNameRegistration = onlyOnceRegistrationSubscriberController
                                                       .RegisterSubscriberName("identity.sharingruleshandler", out IDisposable firstSharingruleshandlerNameHandle);

            firstSharingruleshandlerNameHandle.Dispose();

            bool secondNameRegistration = onlyOnceRegistrationSubscriberController
                                          .RegisterSubscriberName("identity.sharingruleshandler", out IDisposable secondSharingruleshandlerNameHandle);

            //check
            sharingruleshandlerNameRegistration.Should().BeTrue();
            secondNameRegistration.Should().BeTrue();
            firstSharingruleshandlerNameHandle.Should().NotBeNull();
            secondSharingruleshandlerNameHandle.Should().NotBeNull();
        }