public void ConventionalApplicationBindingSupportsBindingGeneration()
        {
            var applicationBinding = new SampleApplication {
                Timestamp = XmlConvert.ToDateTime("2015-02-17T22:51:04+01:00", XmlDateTimeSerializationMode.Local)
            };
            var applicationBindingSerializer = ((IBindingSerializerFactory)applicationBinding).GetBindingSerializer();

            var binding = applicationBindingSerializer.Serialize();

            Assert.That(binding, Is.EqualTo(ResourceManager.LoadString("Data.bindings.xml")));
        }
        public void ConventionalSendPortNameCanBeReferencedInSubscriptionFilter()
        {
            var sendPort = new SampleApplication().CustomerTwoWaySendPort;
            var filter   = new Filter(() => BtsProperties.SendPortName == sendPort.Name);

            Assert.That(
                filter.ToString(),
                Is.EqualTo(
                    string.Format(
                        "<Filter><Group><Statement Property=\"{0}\" Operator=\"{1}\" Value=\"{2}\" /></Group></Filter>",
                        BtsProperties.SendPortName.Type.FullName,
                        (int)FilterOperator.Equals,
                        ((ISupportNamingConvention)sendPort).Name)));
        }
Exemplo n.º 3
0
        public void ConventionalReceivePortNameCanBeReferencedInSubscriptionFilter()
        {
            Skip.IfNot(BizTalkServerGroup.IsConfigured);

            using (new DeploymentContextInjectionScope(targetEnvironment: "ANYWHERE"))
            {
                var receivePort = new SampleApplication().CustomerOneWayReceivePort;
                var filter      = new Filter(() => BtsProperties.ReceivePortName == receivePort.Name);

                filter.ToString().Should().Be(
                    string.Format(
                        CultureInfo.InvariantCulture,
                        "<Filter><Group><Statement Property=\"{0}\" Operator=\"{1}\" Value=\"{2}\" /></Group></Filter>",
                        BtsProperties.ReceivePortName.Type.FullName,
                        (int)FilterOperator.Equals,
                        receivePort.ResolveName()));
            }
        }
Exemplo n.º 4
0
        public void ConventionalApplicationBindingSupportsBindingGeneration()
        {
            Skip.IfNot(BizTalkServerGroup.IsConfigured);

            using (new DeploymentContextInjectionScope(targetEnvironment: "ANYWHERE"))
            {
                var applicationBinding = new SampleApplication {
                    Timestamp = XmlConvert.ToDateTime("2015-02-17T22:51:04+01:00", XmlDateTimeSerializationMode.Local)
                };
                var applicationBindingSerializer = applicationBinding.GetApplicationBindingInfoSerializer();

                var binding = applicationBindingSerializer.Serialize();

                XDocument.Parse(binding).Should().BeEquivalentTo(
                    ResourceManager.Load(
                        Assembly.GetExecutingAssembly(),
                        "Be.Stateless.BizTalk.Resources.Detailed.Application.Bindings.xml",
                        XDocument.Load));
            }
        }