Пример #1
0
        public void Format() {
            var input = new RowsBuilder().Row().Field("f1", true).Field("f2", 8).ToOperation();
            var parameters = new ParametersBuilder().Parameters("f1", "f2").ToParameters();
            var expression = new FormatOperation("o1", "{0} and {1:c}.", parameters);

            var rows = TestOperation(input, expression);

            Assert.AreEqual("True and $8.00.", rows[0]["o1"]);
        }
Пример #2
0
        public void TestCopyFormat() {

            var input = new RowsBuilder()
                .Row("in1", 1).Field("in2", 2)
                .Row("in1", 3).Field("in2", 4)
                .ToOperation();

            var copyParameters = new Parameters(new DefaultFactory(new TestLogger())) { { "in1", "in1", null, "int" }, { "in2", "in2", null, "int" } };

            var formatArrayOperation = new FormatOperation("out", "Here is {0} and here is {1}.", copyParameters);

            var output = TestOperation(input, formatArrayOperation);

            Assert.AreEqual("Here is 1 and here is 2.", output[0]["out"].ToString());
            Assert.AreEqual("Here is 3 and here is 4.", output[1]["out"].ToString());
        }