예제 #1
0
        public void DsfNumberFormatActivity_UpdateForEachInputs_MoreThan1Updates_Updates()
        {
            //------------Setup for test--------------------------
            const string expression            = "[[Numeric(1).num]]";
            const string roundingType          = "Up";
            const string result                = "[[res]]";
            const string roundingDecimalPlaces = "2";
            const string decimalPlacesToShow   = "3";
            var          act = new DsfNumberFormatActivity {
                Expression = expression, RoundingType = roundingType, RoundingDecimalPlaces = roundingDecimalPlaces, DecimalPlacesToShow = decimalPlacesToShow, Result = result
            };

            var tuple1 = new Tuple <string, string>(expression, "Test");
            var tuple2 = new Tuple <string, string>(roundingType, "Test2");
            var tuple3 = new Tuple <string, string>(roundingDecimalPlaces, "Test3");
            var tuple4 = new Tuple <string, string>(decimalPlacesToShow, "Test4");

            //------------Execute Test---------------------------
            act.UpdateForEachInputs(new List <Tuple <string, string> > {
                tuple1, tuple2, tuple3, tuple4
            });
            //------------Assert Results-------------------------
            Assert.AreEqual("Test2", act.RoundingType);
            Assert.AreEqual("Test", act.Expression);
            Assert.AreEqual("Test3", act.RoundingDecimalPlaces);
            Assert.AreEqual("Test4", act.DecimalPlacesToShow);
        }
예제 #2
0
        public void DsfNumberFormatActivity_UpdateForEachInputs_NullUpdates_DoesNothing()
        {
            //------------Setup for test--------------------------
            const string expression            = "[[Numeric(1).num]]";
            const string roundingType          = "Up";
            const string result                = "[[res]]";
            const string roundingDecimalPlaces = "2";
            const string decimalPlacesToShow   = "2";
            var          act = new DsfNumberFormatActivity {
                Expression = expression, RoundingType = roundingType, RoundingDecimalPlaces = roundingDecimalPlaces, DecimalPlacesToShow = decimalPlacesToShow, Result = result
            };

            //------------Execute Test---------------------------
            act.UpdateForEachInputs(null);
            //------------Assert Results-------------------------
            Assert.AreEqual(expression, act.Expression);
            Assert.AreEqual(roundingType, act.RoundingType);
            Assert.AreEqual(roundingDecimalPlaces, act.RoundingDecimalPlaces);
            Assert.AreEqual(decimalPlacesToShow, act.DecimalPlacesToShow);
        }
예제 #3
0
        public void DsfNumberFormatActivity_UpdateForEachInputs_MoreThan1Updates_Updates()
        {
            //------------Setup for test--------------------------
            const string expression = "[[Numeric(1).num]]";
            const string roundingType = "Up";
            const string result = "[[res]]";
            const string roundingDecimalPlaces = "2";
            const string decimalPlacesToShow = "3";
            var act = new DsfNumberFormatActivity { Expression = expression, RoundingType = roundingType, RoundingDecimalPlaces = roundingDecimalPlaces, DecimalPlacesToShow = decimalPlacesToShow, Result = result };

            var tuple1 = new Tuple<string, string>(expression, "Test");
            var tuple2 = new Tuple<string, string>(roundingType, "Test2");
            var tuple3 = new Tuple<string, string>(roundingDecimalPlaces, "Test3");
            var tuple4 = new Tuple<string, string>(decimalPlacesToShow, "Test4");
            //------------Execute Test---------------------------
            act.UpdateForEachInputs(new List<Tuple<string, string>> { tuple1, tuple2, tuple3, tuple4 });
            //------------Assert Results-------------------------
            Assert.AreEqual("Test2", act.RoundingType);
            Assert.AreEqual("Test", act.Expression);
            Assert.AreEqual("Test3", act.RoundingDecimalPlaces);
            Assert.AreEqual("Test4", act.DecimalPlacesToShow);
        }
예제 #4
0
        public void DsfNumberFormatActivity_UpdateForEachInputs_NullUpdates_DoesNothing()
        {
            //------------Setup for test--------------------------
            const string expression = "[[Numeric(1).num]]";
            const string roundingType = "Up";
            const string result = "[[res]]";
            const string roundingDecimalPlaces = "2";
            const string decimalPlacesToShow = "2";
            var act = new DsfNumberFormatActivity { Expression = expression, RoundingType = roundingType, RoundingDecimalPlaces = roundingDecimalPlaces, DecimalPlacesToShow = decimalPlacesToShow, Result = result };

            //------------Execute Test---------------------------
            act.UpdateForEachInputs(null);
            //------------Assert Results-------------------------
            Assert.AreEqual(expression, act.Expression);
            Assert.AreEqual(roundingType, act.RoundingType);
            Assert.AreEqual(roundingDecimalPlaces, act.RoundingDecimalPlaces);
            Assert.AreEqual(decimalPlacesToShow, act.DecimalPlacesToShow);
        }