コード例 #1
0
        public void NotExistPropShouldFail()
        {
            var val = CommonMacros.Iif(SdmapCompilerContext.CreateEmpty(),
                                       "",
                                       new { A = new bool?() },
                                       new object[] { "B", "true", "false" });

            Assert.False(val.IsSuccess);
        }
コード例 #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);
        }
コード例 #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);
        }