Exemplo n.º 1
0
        public void NotExistPropShouldFail()
        {
            var val = CommonMacros.Iif(SdmapCompilerContext.CreateEmpty(),
                                       "",
                                       new { A = new bool?() },
                                       new object[] { "B", "true", "false" });

            Assert.False(val.IsSuccess);
        }
Exemplo n.º 2
0
        public void EmptyNullShouldTreatFalsy()
        {
            var val = CommonMacros.Iif(SdmapCompilerContext.CreateEmpty(),
                                       "",
                                       new { A = new bool?() },
                                       new object[] { "A", "true", "false" });

            Assert.True(val.IsSuccess);
            Assert.Equal("false", val.Value);
        }
Exemplo n.º 3
0
        public void Smoke()
        {
            var val = CommonMacros.Iif(SdmapCompilerContext.CreateEmpty(),
                                       "",
                                       new { A = true },
                                       new object[] { "A", "true", "false" });

            Assert.True(val.IsSuccess);
            Assert.Equal("true", val.Value);
        }