public void IntegerType_ShouldImplement_ValueEquality() { var integerType = new IntegerType(); Assert.That(integerType.Equals(null), Is.False); Assert.That(integerType.Equals(new BooleanType()), Is.False); Assert.That(integerType.Equals(new IntegerType()), Is.True); }
public override TypeValidationResult CheckType() { Type = new IntegerType(); var result = Right.CheckType(); if (result.HasError) { return(result); } if (Type.Equals(result.Type) == false) { return(TypeValidationResult.Invalid(Position, $"Negate operator called with expression which is not integer")); } return(TypeValidationResult.Valid(Type)); }