public void Converter_BooleanNotTests() { BooleanNot conv = new BooleanNot(); // Convert tests Assert.AreEqual(true, conv.Convert(false, typeof(bool), null, null), "BooleanNot Convert returned false instead of true"); Assert.AreEqual(false, conv.Convert(true, typeof(bool), null, null), "BooleanNot Convert returned true instead of false"); // ConvertBack tests Assert.AreEqual(true, conv.ConvertBack(false, typeof(bool), null, null), "BooleanNot Convert returned false instead of true"); Assert.AreEqual(false, conv.ConvertBack(true, typeof(bool), null, null), "BooleanNot Convert returned true instead of false"); }
protected abstract void TranslateBooleanNot(List <string> output, BooleanNot booleanNot);
public static void Compile(ByteCodeCompiler bcc, ParserContext parser, ByteBuffer buffer, BooleanNot boolNot, bool outputUsed) { if (!outputUsed) { throw new ParserException(boolNot, "Cannot have this expression here."); } bcc.CompileExpression(parser, buffer, boolNot.Root, true); buffer.Add(boolNot.FirstToken, OpCode.BOOLEAN_NOT); }
protected override void TranslateBooleanNot(List <string> output, BooleanNot booleanNot) { output.Add("!("); this.TranslateExpression(output, booleanNot.Root); output.Add(")"); }