コード例 #1
0
        public void TypeReferenceIsSetCorrectly()
        {
            var typeReference = EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true);
            NonResourceRangeVariable nonentityRangeVariable = new NonResourceRangeVariable("stuff", typeReference, null);

            Assert.Same(typeReference, nonentityRangeVariable.TypeReference);
        }
コード例 #2
0
        public void KindIsNonEntityRangeVariableReferenceNode()
        {
            NonResourceRangeVariable rangeVariable = new NonResourceRangeVariable("stuff", EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true), null);
            NonResourceRangeVariableReferenceNode nonentityRangeVariableReferenceNode = new NonResourceRangeVariableReferenceNode("stuff", rangeVariable);

            Assert.Equal(nonentityRangeVariableReferenceNode.InternalKind, InternalQueryNodeKind.NonResourceRangeVariableReference);
        }
コード例 #3
0
        public void TypeReferenceIsSetCorrectly()
        {
            NonResourceRangeVariable rangeVariable = new NonResourceRangeVariable("stuff", EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true), null);
            NonResourceRangeVariableReferenceNode nonentityRangeVariableReferenceNode = new NonResourceRangeVariableReferenceNode("stuff", rangeVariable);

            Assert.Equal(EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true).FullName(), nonentityRangeVariableReferenceNode.TypeReference.FullName());
        }
コード例 #4
0
        public void RangeVariableIsSetCorrectly()
        {
            NonResourceRangeVariable rangeVariable = new NonResourceRangeVariable("stuff", EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true), null);
            NonResourceRangeVariableReferenceNode nonentityRangeVariableReferenceNode = new NonResourceRangeVariableReferenceNode("stuff", rangeVariable);

            nonentityRangeVariableReferenceNode.RangeVariable.ShouldBeNonentityRangeVariable("stuff");
        }
コード例 #5
0
        private SingleValueNode Parameter <T>(string name)
        {
            var nonentityRangeVariable = new NonResourceRangeVariable(name, null, null);

            this.testSubject.ParameterExpressions[nonentityRangeVariable] = Expression.Parameter(typeof(T), name);
            return(new NonResourceRangeVariableReferenceNode(name, nonentityRangeVariable));
        }
コード例 #6
0
        public void NameCannotBeNull()
        {
            NonResourceRangeVariable rangeVariable = new NonResourceRangeVariable("stuff", EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true), null);
            Action createWithNullName = () => new NonResourceRangeVariableReferenceNode(null, rangeVariable);

            Assert.Throws <ArgumentNullException>("name", createWithNullName);
        }
コード例 #7
0
        public void NameCannotBeNull()
        {
            NonResourceRangeVariable rangeVariable = new NonResourceRangeVariable("stuff", EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true), null);
            Action createWithNullName = () => new NonResourceRangeVariableReferenceNode(null, rangeVariable);

            createWithNullName.ShouldThrow <Exception>(Error.ArgumentNull("name").ToString());
        }
コード例 #8
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(NonResourceRangeVariable node)
 {
     return(tabHelper.Prefix + "NonResourceRangeVariable" +
            tabHelper.Indent(() =>
                             tabHelper.Prefix + "Name = " + node.Name +
                             tabHelper.Prefix + "TypeReference = " + node.TypeReference
                             ));
 }
コード例 #9
0
        public void NonResourceRangeVariableReferenceNodeNotImplemented()
        {
            FakeVisitor              visitor   = new FakeVisitor();
            ConstantNode             constNode = new ConstantNode("stuff");
            NonResourceRangeVariable nonentityRangeVariable = new NonResourceRangeVariable("dummy", constNode.TypeReference, null);
            NonResourceRangeVariableReferenceNode nonResourceRangeVariableReferenceNode = new NonResourceRangeVariableReferenceNode(nonentityRangeVariable.Name, nonentityRangeVariable);
            Action visitNonResourceRangeVariableReferenceNode = () => visitor.Visit(nonResourceRangeVariableReferenceNode);

            Assert.Throws <NotImplementedException>(visitNonResourceRangeVariableReferenceNode);
        }
コード例 #10
0
ファイル: QueryNodeComparer.cs プロジェクト: zhonli/odata.net
 /// <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(NonResourceRangeVariable left, NonResourceRangeVariable right)
 {
     if (left.Name != right.Name)
     {
         return(false);
     }
     if (left.TypeReference != right.TypeReference)
     {
         return(false);
     }
     return(true);
 }
コード例 #11
0
        public void KindIsNonEntityRangeVariable()
        {
            NonResourceRangeVariable nonentityRangeVariable = new NonResourceRangeVariable("stuff", EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true), null);

            Assert.Equal(RangeVariableKind.NonResource, nonentityRangeVariable.Kind);
        }
コード例 #12
0
        public void NameIsSetCorrectly()
        {
            NonResourceRangeVariable nonentityRangeVariable = new NonResourceRangeVariable("stuff", EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true), null);

            Assert.Equal("stuff", nonentityRangeVariable.Name);
        }
コード例 #13
0
 static string BindRangeVariable(NonResourceRangeVariable nonentityRangeVariable, DbUtility dbUtility)
 {
     return(nonentityRangeVariable.Name);
 }
コード例 #14
0
        public void KindIsNonEntityRangeVariable()
        {
            NonResourceRangeVariable nonentityRangeVariable = new NonResourceRangeVariable("stuff", EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true), null);

            nonentityRangeVariable.Kind.Should().Be(RangeVariableKind.NonResource);
        }