コード例 #1
0
 /// <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;
 }
コード例 #2
0
 public void KindIsNonEntityRangeVariable()
 {
     NonentityRangeVariable nonentityRangeVariable = new NonentityRangeVariable("stuff", EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true), null);
     nonentityRangeVariable.Kind.Should().Be(RangeVariableKind.Nonentity);
 }
コード例 #3
0
 public void TypeReferenceIsSetCorrectly()
 {
     var typeReference = EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true);
     NonentityRangeVariable nonentityRangeVariable = new NonentityRangeVariable("stuff", typeReference, null);
     nonentityRangeVariable.TypeReference.Should().BeSameAs(typeReference);
 }
コード例 #4
0
 public void NameIsSetCorrectly()
 {
     NonentityRangeVariable nonentityRangeVariable = new NonentityRangeVariable("stuff", EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true), null);
     nonentityRangeVariable.Name.Should().Be("stuff");
 }
コード例 #5
0
 /// <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;
 }
コード例 #6
0
 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);
 }
コード例 #7
0
 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");
 }
コード例 #8
0
 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());
 }
コード例 #9
0
 private string BindRangeVariable(NonentityRangeVariable nonentityRangeVariable)
 {
     return nonentityRangeVariable.Name.ToString();
 }
コード例 #10
0
 /// <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
         );
 }