コード例 #1
0
        public void ExecutePropertyMember()
        {
            Facts.Assert(Context.Property(FileProperties.ReceivedFileName).WithValue("token.csv"));

            ExecutePolicy();

            Facts.Verify(Context.Property(BizTalkFactoryProperties.CorrelationToken).WithValue("computed value!").HasBeenWritten());
        }
コード例 #2
0
        public void BooleanPredicateResolution()
        {
            Facts.Assert(Context.Property(BtsProperties.AckRequired).WithValue(true));

            ExecutePolicy();

            Facts.Verify(Context.Property(BtsProperties.ReceivePortName).WithValue("AckRequired").HasBeenWritten());
        }
コード例 #3
0
        public void NotEqualToStringResolution()
        {
            Facts.Assert(Context.Property(BtsProperties.ReceiveLocationName).WithValue("ActualReceiveLocationName"));

            ExecutePolicy();

            Facts.Verify(Context.Property(BtsProperties.ReceivePortName).WithValue("NotEqualToString").HasBeenWritten());
        }
コード例 #4
0
        public void NotEqualToIntegerResolution()
        {
            Facts.Assert(Context.Property(BtsProperties.ActualRetryCount).WithValue(2));

            ExecutePolicy();

            Facts.Verify(Context.Property(BtsProperties.ReceivePortName).WithValue("NotEqualToInteger").HasBeenWritten());
        }
コード例 #5
0
        public void StaticConstResolution()
        {
            Facts.Assert(Context.Property(BtsProperties.AckRequired).WithValue(true));

            ExecutePolicy();

            Facts.Verify(Context.Property(TrackingProperties.ProcessName).WithValue(Dummy.Processes.Three).HasBeenWritten());
        }
コード例 #6
0
        public void UnqualifiedFieldResolution()
        {
            Facts.Assert(Context.Property(BtsProperties.SuppressRoutingFailureDiagnosticInfo).WithValue(true));

            ExecutePolicy();

            Facts.Verify(Context.Property(TrackingProperties.ProcessName).WithValue(Dummy.Processes.Four).HasBeenWritten());
        }
        public void IndirectAccess()
        {
            Facts.Assert(Context.Property(FileProperties.ReceivedFileName).WithValue("some-accessViaVariable-file.csv"));

            ExecutePolicy();

            Facts.Verify(Context.Property(BizTalkFactoryProperties.SenderName).WithValue("variableValue").HasBeenPromoted());
        }
コード例 #8
0
        public void QualifiedPropertyResolution()
        {
            Facts.Assert(Context.Property(BtsProperties.IsRequestResponse).WithValue(true));

            ExecutePolicy();

            Facts.Verify(Context.Property(TrackingProperties.ProcessName).WithValue(Dummy.Processes.One).HasBeenWritten());
        }
コード例 #9
0
        public void ExecuteRule()
        {
            Facts.Assert(Context.Property(BtsProperties.MessageType).WithValue("WriteFromContext"));

            ExecutePolicy();

            Facts.Verify(Context.Property(TrackingProperties.ProcessName).WithValue("WriteFromContext").HasBeenWritten());
        }
コード例 #10
0
        public void StaticCallResolution()
        {
            Facts.Assert(Context.Property(BizTalkFactoryProperties.CorrelationToken).WithValue("StaticCallResolution"));

            ExecutePolicy();

            Facts.Verify(Context.Property(TrackingProperties.ProcessName).WithValue("HelloFromStaticCallResolution").HasBeenWritten());
        }
コード例 #11
0
        public void StaticPropertyResolution()
        {
            Facts.Assert(Context.Property(BizTalkFactoryProperties.CorrelationToken).WithValue("StaticPropertyResolution"));

            ExecutePolicy();

            Facts.Verify(Context.Property(FileProperties.FileCreationTime).WithValue(DateTime.Today).HasBeenWritten());
        }
コード例 #12
0
        public void NegationResolution()
        {
            Facts.Assert(Context.Property(BtsProperties.AckRequired).WithValue(false));

            ExecutePolicy();

            Facts.Verify(Context.Property(BtsProperties.ReceivePortName).WithValue("NotAckRequired").HasBeenWritten());
        }
コード例 #13
0
        public void ExecuteConstantToLambdaToExpressionRule()
        {
            Facts.Assert(Context.Property(FileProperties.ReceivedFileName).WithValue("no-folder-file.csv"));

            ExecutePolicy();

            Facts.Verify(Context.Property(BizTalkFactoryProperties.OutboundTransportLocation).WithValue("folder/no-folder-file.csv").HasBeenWritten());
        }
コード例 #14
0
        public void NegationResolutionWhenBoolPropertyIsMissingFromFactBase()
        {
            // Asserting a false boolean is useless as it will be assumed to be false
            // Facts.Assert(Context.Property(BtsProperties.AckRequired).WithValue(false));

            ExecutePolicy();

            Facts.Verify(Context.Property(BtsProperties.ReceivePortName).WithValue("NotAckRequired").HasBeenWritten());
        }
コード例 #15
0
        public void ExtensionMethodResolution()
        {
            Facts
            .Assert(Context.Property(BizTalkFactoryProperties.CorrelationToken).WithValue("ExtensionMethodResolution"))
            .Assert(Context.Property(BizTalkFactoryProperties.SenderName).WithValue("0000001234567890"));

            ExecutePolicy();

            Facts.Verify(Context.Property(TrackingProperties.ProcessName).WithValue("00001234567890").HasBeenWritten());
        }
コード例 #16
0
        public void TypeMemberAccessRule()
        {
            Facts.Assert(Context.Property(BtsProperties.MessageType).WithValue(Schema <btf2_envelope> .MessageType));

            ExecutePolicy();

            Facts
            .Verify(Context.Property(BizTalkFactoryProperties.ReceiverName).WithValue("ControlBasedBatcher").HasBeenPromoted())
            .Verify(Context.Property(BizTalkFactoryProperties.EnvelopeSpecName).WithValue(typeof(btf2_envelope).AssemblyQualifiedName).HasBeenPromoted());
        }
コード例 #17
0
        public void ProcessTwoResolution()
        {
            Facts
            .Assert(Context.Property(BtsProperties.MessageType).WithValue("Z_IDOC#TWO"))
            .Assert(Context.Property(BtsProperties.InboundTransportType).WithValue("WCF-SAP"));

            ExecutePolicy();

            Facts.Verify(Context.Property(TrackingProperties.ProcessName).WithValue(Dummy.Processes.Two).HasBeenWritten());
        }
コード例 #18
0
        public void NoResolution()
        {
            Facts
            .Assert(Context.Property(BtsProperties.MessageType).WithValue("UNKNOWN"))
            .Assert(Context.Property(BtsProperties.InboundTransportType).WithValue("WCF-SAP"));

            ExecutePolicy();

            Facts.Verify(Context.Property(TrackingProperties.ProcessName).HasNotBeenSet());
        }
コード例 #19
0
        public void ProcessTenBResolution()
        {
            Facts
            .Assert(Context.Property(BtsProperties.MessageType).WithValue("Z_IDOC#TEN"))
            .Assert(Context.Property(BizTalkFactoryProperties.CorrelationToken).WithValue("Z2UMD_392_DEM_CAN"));

            ExecutePolicy();

            Facts.Verify(Context.Property(TrackingProperties.ProcessName).WithValue("ProcessTen").HasBeenWritten());
        }
コード例 #20
0
        public void ClearingFactList()
        {
            Facts.Assert(Context.Property(BtsProperties.MessageType).WithValue("message-type"));

            RuleEngine.Facts.Clear();

            ExecutePolicy();

            Facts.Verify(Context.Property(TrackingProperties.ProcessName).HasNotBeenSet());
        }
コード例 #21
0
        public void WithoutClearingFactList()
        {
            Facts.Assert(Context.Property(BtsProperties.MessageType).WithValue("message-type"));

            ExecutePolicy();

            Assert.That(
                () => Facts.Verify(Context.Property(TrackingProperties.ProcessName).HasNotBeenSet()),
                Throws.TypeOf <MockException>());
        }
コード例 #22
0
        public void MessageTypeResolution()
        {
            Facts.Assert(Context.Property(BtsProperties.MessageType).WithValue(Schema <btf2_services_header> .MessageType));

            ExecutePolicy();

            Facts
            .Verify(Context.Property(BizTalkFactoryProperties.CorrelationToken).WithValue(Schema <btf2_envelope> .MessageType).HasBeenWritten())
            .Verify(Context.Property(BizTalkFactoryProperties.EnvelopeSpecName).WithValue(new SchemaMetadata <btf2_envelope>().DocumentSpec.DocSpecStrongName).HasBeenWritten())
            .Verify(Context.Property(BizTalkFactoryProperties.EnvelopeSpecName).WithValue(Schema <btf2_envelope> .AssemblyQualifiedName).HasBeenWritten());
        }
コード例 #23
0
        public void TransformTypeResolution()
        {
            Facts
            .Assert(Context.Property(BtsProperties.MessageType).WithValue("Z_IDOC#SIX"))
            .Assert(Context.Property(BtsProperties.InboundTransportType).WithValue("WCF-SAP"));

            ExecutePolicy();

            Facts
            .Verify(Context.Property(TrackingProperties.ProcessName).WithValue(Dummy.Processes.One).HasBeenWritten())
            .Verify(Context.Property(BizTalkFactoryProperties.MapTypeName).WithValue(Transform <TransformBase> .MapTypeName).HasBeenWritten());
        }
コード例 #24
0
 public void ExecuteRule()
 {
     ExecutePolicy();
     Facts.Verify(Context.Property(BtsProperties.ReceivePortName).WithValue("AlwaysTrue").HasBeenWritten());
 }
コード例 #25
0
 public void WriteProcessNameInContext()
 {
     ExecutePolicy();
     Facts.Verify(Context.Property(TrackingProperties.ProcessName).WithValue(Factory.Areas.Claim.Processes.Check).HasBeenWritten());
 }
コード例 #26
0
 public void DoNotWriteProcessNameInContext()
 {
     Facts.Assert(Context.Property(TrackingProperties.ProcessName).WithValue("some-process-name"));
     ExecutePolicy();
     Facts.Verify(Context.Property(TrackingProperties.ProcessName).WithAnyValue().HasNotBeenWritten());
 }
コード例 #27
0
 public void ImplicitBoxingIsHandledDuringTranslation()
 {
     ExecutePolicy();
     Facts.Verify(Context.Property(BizTalkFactoryProperties.CorrelationToken).WithAnyValue().HasBeenWritten());
 }
コード例 #28
0
 public void WriteProcessNameInContext()
 {
     ExecutePolicy();
     Facts.Verify(Context.Property(TrackingProperties.ProcessName).WithValue(Default.Processes.Failed).HasBeenWritten());
 }