/// <summary> /// Creates a <see cref="NonentityRangeVariableReferenceNode"/>. /// </summary> /// <param name="name"> The name of the associated rangeVariable</param> /// <param name="rangeVariable">Reference to a rangeVariable on the binding stack.</param> /// <exception cref="System.ArgumentNullException">Throws if input name or rangeVariable is null.</exception> public NonentityRangeVariableReferenceNode(string name, NonentityRangeVariable rangeVariable) { ExceptionUtils.CheckArgumentNotNull(name, "name"); ExceptionUtils.CheckArgumentNotNull(rangeVariable, "rangeVariable"); this.name = name; this.typeReference = rangeVariable.TypeReference; this.rangeVariable = rangeVariable; }
public void KindIsNonEntityRangeVariable() { NonentityRangeVariable nonentityRangeVariable = new NonentityRangeVariable("stuff", EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true), null); nonentityRangeVariable.Kind.Should().Be(RangeVariableKind.Nonentity); }
public void TypeReferenceIsSetCorrectly() { var typeReference = EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true); NonentityRangeVariable nonentityRangeVariable = new NonentityRangeVariable("stuff", typeReference, null); nonentityRangeVariable.TypeReference.Should().BeSameAs(typeReference); }
public void NameIsSetCorrectly() { NonentityRangeVariable nonentityRangeVariable = new NonentityRangeVariable("stuff", EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true), null); nonentityRangeVariable.Name.Should().Be("stuff"); }
/// <summary> /// Compares non entity parameter query nodes query nodes. /// </summary> /// <param name="left">Left side of comparison</param> /// <param name="right">Right side of comparison</param> /// <returns>True if equal, otherwise false</returns> private bool Compare(NonentityRangeVariable left, NonentityRangeVariable right) { if (left.Name != right.Name) return false; if (left.TypeReference != right.TypeReference) return false; return true; }
public void KindIsNonEntityRangeVariableReferenceNode() { NonentityRangeVariable rangeVariable = new NonentityRangeVariable("stuff", EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true), null); NonentityRangeVariableReferenceNode nonentityRangeVariableReferenceNode = new NonentityRangeVariableReferenceNode("stuff", rangeVariable); nonentityRangeVariableReferenceNode.InternalKind.Should().Be(InternalQueryNodeKind.NonentityRangeVariableReference); }
public void RangeVariableIsSetCorrectly() { NonentityRangeVariable rangeVariable = new NonentityRangeVariable("stuff", EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true), null); NonentityRangeVariableReferenceNode nonentityRangeVariableReferenceNode = new NonentityRangeVariableReferenceNode("stuff", rangeVariable); nonentityRangeVariableReferenceNode.RangeVariable.ShouldBeNonentityRangeVariable("stuff"); }
public void NameCannotBeNull() { NonentityRangeVariable rangeVariable = new NonentityRangeVariable("stuff", EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true), null); Action createWithNullName = () => new NonentityRangeVariableReferenceNode(null, rangeVariable); createWithNullName.ShouldThrow<Exception>(Error.ArgumentNull("name").ToString()); }
private string BindRangeVariable(NonentityRangeVariable nonentityRangeVariable) { return nonentityRangeVariable.Name.ToString(); }
/// <summary> /// Compares non entity parameter query nodes query nodes. /// </summary> /// <param name="node">Node to write to string</param> /// <returns>String representation of node.</returns> private static string ToString(NonentityRangeVariable node) { return tabHelper.Prefix + "NonentityRangeVariable" + tabHelper.Indent(() => tabHelper.Prefix + "Name = " + node.Name + tabHelper.Prefix + "TypeReference = " + node.TypeReference ); }