protected override object ImportFromBoolean(ImportContext context, JsonReader reader) { Debug.Assert(context != null); Debug.Assert(reader != null); return(BooleanObject.Box(reader.ReadBoolean())); }
public void Evaluate_CanEvalBooleanExpressions(string input, bool expected) { IObject actual = this.subject.Evaluate(input, this.environment); Assert.NotNull(actual); BooleanObject intResult = this.AssertAndCast <BooleanObject>(actual); Assert.Equal(expected, intResult.Value); }
/// <summary> /// Creates a BooleanResponse object from its byte representation /// </summary> /// <param name="input">Byte representation of the object</param> public BooleanResponse(byte[] input) { if (input == null) return; booleanObject = BooleanObject.CreateBuilder().MergeFrom(input).Build(); Console.WriteLine(booleanObject.Istrue); data = booleanObject.Istrue; }
/// <summary> /// Constructs an instance of the class with the specified parameters. /// </summary> /// <param name="args">The parameters passed to the constructor.</param> /// <returns>The created instance of the class.</returns> public override IScriptObject Construct(List <IScriptObject> args) { var ins = new BooleanObject(); if (Constructor != null) { Constructor.Invoke(ins, args); } return(ins); }
/// <summary> /// Creates a BooleanResponse object from its byte representation /// </summary> /// <param name="input">Byte representation of the object</param> public BooleanResponse(byte[] input) { if (input == null) { return; } booleanObject = BooleanObject.CreateBuilder().MergeFrom(input).Build(); Console.WriteLine(booleanObject.Istrue); data = booleanObject.Istrue; }
public void ObtainBoolean(string fragment, bool?expected) { /// 7.3.2 Boolean objects byte[] bytes = System.Text.UTF8Encoding.UTF8.GetBytes(fragment); Tokenizer feed = new Tokenizer(new MemoryStream(bytes)); Objectizer objectizer = new Objectizer(feed); BooleanObject actual = (BooleanObject)objectizer.NextObject(); Assert.Equal(expected, actual.Value); }
protected override object ImportFromNumber(ImportContext context, JsonReader reader) { Debug.Assert(context != null); Debug.Assert(reader != null); try { return(BooleanObject.Box(reader.ReadNumber().ToInt64() != 0)); } catch (FormatException innerException) { throw new JsonException($"The JSON Number {reader.Text} must be an integer to be convertible to System.Boolean.", innerException); } }
public override Task <BooleanObject> SetRolePermission(SetRolePermissionRequest request, ServerCallContext context) { var res = new BooleanObject(); if (request.Has) { if (!_roleDao.ExistPermission(request.RoleId, request.PermissionCode)) { res.Body = _roleDao.AddRolePermission(request.RoleId, request.PermissionCode); } } else { res.Body = _roleDao.DeleteRolePermission(request.RoleId, request.PermissionCode); } return(Task.FromResult(res)); }
public static double op_Addition(None x, [NotNull] BooleanObject y) { throw new NotImplementedException(); }
protected override object ImportFromBoolean(ImportContext context, JsonReader reader) { return BooleanObject.Box(reader.ReadBoolean()); }
public static double op_Addition(decimal x, BooleanObject y) { throw new NotImplementedException(); }
protected override object ImportFromBoolean(ImportContext context, JsonReader reader) { return(Convert.ChangeType(BooleanObject.Box(reader.ReadBoolean()), OutputType)); }
public static string op_Addition([NotNull] BooleanObject x, [NotNull] ConcatString y) { throw new NotImplementedException(); }
public static double op_Addition([NotNull] BooleanObject x, [NotNull] UnDefined y) { throw new NotImplementedException(); }
public static ConcatString op_Addition(ConcatString x, BooleanObject y) { return(new ConcatString(x, Convert.ToString(y))); }
public BooleanValueEval(BooleanObject booleanObject) { BooleanObject = booleanObject; }
// vvv http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.10 public bool isCloseConnectionIndicated() { if (null != _closeConnectionIndicated) { return _closeConnectionIndicated.booleanValue(); } if (!_headers.ContainsKey("connection")) { _closeConnectionIndicated = BooleanObject.FALSE; } else { if ("close".Equals(_headers["connection"])) { _closeConnectionIndicated = BooleanObject.TRUE; } else { _closeConnectionIndicated = BooleanObject.FALSE; } } return _closeConnectionIndicated.booleanValue(); }