Beispiel #1
0
 public virtual DmnDecisionResultException decisionOutputHasMoreThanOneValue(IDmnDecisionResultEntries result)
 {
     return
         (new DmnDecisionResultException(ExceptionMessage("010",
                                                          string.Format("Unable to get single decision result entry as it has more than one entry '{0}'",
                                                                        result))));
 }
Beispiel #2
0
        public virtual void testSingleEntry()
        {
            startTestProcess("single entry");

            IDmnDecisionResultEntries firstOutput = results[0];

            Assert.AreEqual("foo", firstOutput.GetFirstEntry());
            Assert.AreEqual(Variables.StringValue("foo"), firstOutput.GetFirstEntryTyped <ITypedValue>());
        }
Beispiel #3
0
        public virtual void testEmptyOutput()
        {
            startTestProcess("empty output");

            Assert.IsFalse(!results.Any(), "The decision result 'ruleResult' should not be empty");

            IDmnDecisionResultEntries decisionOutput = results[0];

            Assert.IsNull(decisionOutput.GetFirstEntry());
        }
Beispiel #4
0
        public virtual void testCollectSumHitPolicySingleEntryList()
        {
            startTestProcess("single entry list");

            Assert.AreEqual(1, results.Count);
            IDmnDecisionResultEntries firstOutput = results[0];

            Assert.AreEqual(33, firstOutput.GetFirstEntry());
            Assert.AreEqual(Variables.IntegerValue(33), firstOutput.GetFirstEntryTyped <ITypedValue>());
        }
Beispiel #5
0
        public virtual void testCollectCountHitPolicyNoOutput()
        {
            startTestProcess("no output");

            Assert.AreEqual(1, results.Count);
            IDmnDecisionResultEntries firstOutput = results[0];

            Assert.AreEqual(0, firstOutput.GetFirstEntry());
            Assert.AreEqual(Variables.IntegerValue(0), firstOutput.GetFirstEntryTyped <ITypedValue>());
        }
Beispiel #6
0
        public virtual void testMultipleEntries()
        {
            startTestProcess("multiple entries");

            IDmnDecisionResultEntries firstOutput = results[0];

            Assert.AreEqual(Variables.StringValue("foo"), firstOutput["result1"]);
            Assert.AreEqual(Variables.StringValue("bar"), firstOutput["result2"]);

            Assert.AreEqual(Variables.StringValue("foo"), firstOutput.GetEntryTyped <ITypedValue>("result1"));
            Assert.AreEqual(Variables.StringValue("bar"), firstOutput.GetEntryTyped <ITypedValue>("result2"));
        }
Beispiel #7
0
 public bool Remove(IDmnDecisionResultEntries item)
 {
     return(ruleResults.Remove(item));
 }
Beispiel #8
0
 public bool Contains(IDmnDecisionResultEntries item)
 {
     return(ruleResults.Contains(item));
 }
Beispiel #9
0
 public void Add(IDmnDecisionResultEntries item)
 {
     ruleResults.Add(item);
 }
Beispiel #10
0
 public void Insert(int index, IDmnDecisionResultEntries item)
 {
     ruleResults.Insert(index, item);
 }
Beispiel #11
0
 public int IndexOf(IDmnDecisionResultEntries item)
 {
     return(ruleResults.IndexOf(item));
 }