Beispiel #1
0
        public void ComputeReceivePortNameRequiresApplicationBinding()
        {
            var receivePortMock = new Mock <IReceivePort <NamingConventionSpy> >();

            receivePortMock.Setup(rp => rp.GetType()).Returns(typeof(StandaloneReceivePort));

            var sut = new NamingConventionSpy();

            Invoking(() => sut.ComputeReceivePortNameSpy(receivePortMock.Object))
            .Should().Throw <NamingConventionException>()
            .WithMessage($"'{nameof(StandaloneReceivePort)}' ReceivePort is not bound to application's receive port collection.");
        }
Beispiel #2
0
        public void ComputeReceivePortNameRequiresParty()
        {
            var applicationBindingMock = new Mock <IApplicationBinding <NamingConventionSpy> >();

            var receivePortMock = new Mock <IReceivePort <NamingConventionSpy> >();

            receivePortMock.Setup(rp => rp.GetType()).Returns(typeof(StandaloneReceivePort));
            receivePortMock.Setup(rp => rp.ApplicationBinding).Returns(applicationBindingMock.Object);

            var sut = new NamingConventionSpy();

            Invoking(() => sut.ComputeReceivePortNameSpy(receivePortMock.Object))
            .Should().Throw <NamingConventionException>()
            .WithMessage($"'{nameof(StandaloneReceivePort)}' ReceivePort's Party is required.");
        }
Beispiel #3
0
        public void ComputeReceivePortNameEmbedsApplicationNameAndParty()
        {
            var applicationBindingMock = new Mock <IApplicationBinding <NamingConventionSpy> >();

            applicationBindingMock.Setup(snc => snc.ResolveName()).Returns("SomeApplication");

            var receivePortMock = new Mock <IReceivePort <NamingConventionSpy> >();

            receivePortMock.Setup(rp => rp.GetType()).Returns(typeof(StandaloneReceivePort));
            receivePortMock.Setup(rp => rp.ApplicationBinding).Returns(applicationBindingMock.Object);

            var sut = new NamingConventionSpy {
                Party = "SomeParty"
            };

            sut.ComputeReceivePortNameSpy(receivePortMock.Object).Should().Be("SomeApplication.RP1.SomeParty");
        }
Beispiel #4
0
        public void ComputeReceivePortNameTwoWay()
        {
            Skip.IfNot(BizTalkServerGroup.IsConfigured);

            var applicationBindingMock = new Mock <IApplicationBinding <NamingConventionSpy> >();

            applicationBindingMock.Setup(snc => snc.ResolveName()).Returns("SomeApplication");

            var receivePortMock = new Mock <IReceivePort <NamingConventionSpy> >();

            receivePortMock.Setup(rp => rp.GetType()).Returns(typeof(StandaloneReceivePort));
            receivePortMock.Setup(rp => rp.ApplicationBinding).Returns(applicationBindingMock.Object);
            receivePortMock.Setup(rp => rp.IsTwoWay).Returns(true);

            var sut = new NamingConventionSpy {
                Party = "SomeParty"
            };

            sut.ComputeReceivePortNameSpy(receivePortMock.Object).Should().Be("SomeApplication.RP2.SomeParty");
        }