Ejemplo n.º 1
0
        public void TestFunctionalQueryFieldGetStringWithIndex()
        {
            // Prepare
            var functionalQueryField = new FunctionalQueryField("FieldName", Operation.Equal, "Value", "FUNC({0})");

            // Act
            var text = functionalQueryField.GetString(1, new CustomDbSetting());

            // Assert
            Assert.AreEqual("FUNC([FieldName]) = @FieldName_1", text);
        }
Ejemplo n.º 2
0
        public void TestFunctionalQueryFieldGetStringWithMultipleFunctions()
        {
            // Prepare
            var functionalQueryField = new FunctionalQueryField("FieldName", Operation.Equal, "Value", "FUNC1({0}) = @Value AND FUNC2({0})");

            // Act
            var text = functionalQueryField.GetString(0, new CustomDbSetting());

            // Assert
            Assert.AreEqual("FUNC1([FieldName]) = @Value AND FUNC2([FieldName]) = @FieldName", text);
        }
Ejemplo n.º 3
0
        public void TestFunctionalQueryFieldConstructor()
        {
            // Prepare
            var functionalQueryField = new FunctionalQueryField("FieldName", Operation.NotEqual, "Value", "FUNC({0})");

            // Assert
            Assert.AreEqual("FieldName", functionalQueryField.Field.Name);
            Assert.AreEqual(Operation.NotEqual, functionalQueryField.Operation);
            Assert.AreEqual("Value", functionalQueryField.Parameter.Value);
            Assert.AreEqual("FUNC({0})", functionalQueryField.Format);
        }