public void TypeReferenceIsSetCorrectly() { var typeReference = EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true); NonResourceRangeVariable nonentityRangeVariable = new NonResourceRangeVariable("stuff", typeReference, null); Assert.Same(typeReference, nonentityRangeVariable.TypeReference); }
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); }
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()); }
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"); }
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)); }
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); }
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()); }
/// <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 )); }
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); }
/// <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); }
public void KindIsNonEntityRangeVariable() { NonResourceRangeVariable nonentityRangeVariable = new NonResourceRangeVariable("stuff", EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true), null); Assert.Equal(RangeVariableKind.NonResource, nonentityRangeVariable.Kind); }
public void NameIsSetCorrectly() { NonResourceRangeVariable nonentityRangeVariable = new NonResourceRangeVariable("stuff", EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true), null); Assert.Equal("stuff", nonentityRangeVariable.Name); }
static string BindRangeVariable(NonResourceRangeVariable nonentityRangeVariable, DbUtility dbUtility) { return(nonentityRangeVariable.Name); }
public void KindIsNonEntityRangeVariable() { NonResourceRangeVariable nonentityRangeVariable = new NonResourceRangeVariable("stuff", EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Double, true), null); nonentityRangeVariable.Kind.Should().Be(RangeVariableKind.NonResource); }