Skip to content

Commit

Permalink
Renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
WanjohiSammy committed Sep 13, 2024
1 parent 8277c6d commit 3d27793
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public override IEdmEntityTypeReference EntityTypeReference

public static FakeSingleEntityNode CreateFakeNodeForPerson()
{
var personType = EdmModelBuilder.GetEntityType("Microsoft.FullyQualified.NS.Person");
return new FakeSingleEntityNode(EdmModelBuilder.GetEntityTypeReference(personType), EdmModelBuilder.GetPeopleSet());
var personType = HardCodedTestModel.GetEntityType("Microsoft.FullyQualified.NS.Person");
return new FakeSingleEntityNode(HardCodedTestModel.GetEntityTypeReference(personType), HardCodedTestModel.GetPeopleSet());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Microsoft.AspNetCore.OData.Tests.Query.Expressions
{
internal static class EdmModelBuilder
internal static class HardCodedTestModel
{
private static readonly IEdmModel Model = BuildAndGetEdmModel();

Expand Down Expand Up @@ -48,7 +48,7 @@ public static IEdmEntitySet GetPeopleSet()
return TestModel.EntityContainer.FindEntitySet("People");
}

public static IEdmModel BuildAndGetEdmModel()
private static IEdmModel BuildAndGetEdmModel()
{
var builder = new ODataConventionModelBuilder();
builder.Namespace = "Microsoft.FullyQualified.NS";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ public void BindSingleResourceFunctionCallNode_CastingEntityType_ReturnsExpressi
// Arrange
var binder = new MyQueryBinder();

var model = EdmModelBuilder.BuildAndGetEdmModel();
var model = HardCodedTestModel.TestModel;

// Create the type reference and navigation source
var personType = EdmModelBuilder.GetEntityType("Microsoft.FullyQualified.NS.Person");
var personTypeRef = EdmModelBuilder.GetEntityTypeReference(personType);
var personType = HardCodedTestModel.GetEntityType("Microsoft.FullyQualified.NS.Person");
var personTypeRef = HardCodedTestModel.GetEntityTypeReference(personType);
var collectionNode = FakeCollectionResourceNode.CreateFakeNodeForPerson();

var employeeType = EdmModelBuilder.GetEntityType("Microsoft.FullyQualified.NS.Employee");
var employeeType = HardCodedTestModel.GetEntityType("Microsoft.FullyQualified.NS.Employee");

// Create a ResourceRangeVariableReferenceNode for the Person entity
var rangeVariable = new ResourceRangeVariable("$it", personTypeRef, collectionNode);
Expand Down Expand Up @@ -174,22 +174,22 @@ public void BindSingleResourceFunctionCallNode_PropertyCasting_ReturnsExpression
// Arrange
var binder = new MyQueryBinder();

var model = EdmModelBuilder.BuildAndGetEdmModel();
var model = HardCodedTestModel.TestModel;

// Create the type reference and navigation source
var personType = EdmModelBuilder.GetEntityType("Microsoft.FullyQualified.NS.Person");
var personTypeRef = EdmModelBuilder.GetEntityTypeReference(personType);
var personType = HardCodedTestModel.GetEntityType("Microsoft.FullyQualified.NS.Person");
var personTypeRef = HardCodedTestModel.GetEntityTypeReference(personType);
var collectionNode = FakeCollectionResourceNode.CreateFakeNodeForPerson();

var myAddressType = EdmModelBuilder.GetEdmComplexType("Microsoft.FullyQualified.NS.MyAddress");
var workAddressType = EdmModelBuilder.GetEdmComplexType("Microsoft.FullyQualified.NS.WorkAddress");
var myAddressType = HardCodedTestModel.GetEdmComplexType("Microsoft.FullyQualified.NS.MyAddress");
var workAddressType = HardCodedTestModel.GetEdmComplexType("Microsoft.FullyQualified.NS.WorkAddress");

// Create a ResourceRangeVariableReferenceNode for the Person entity
var rangeVariable = new ResourceRangeVariable("$it", personTypeRef, collectionNode);
var personNode = new ResourceRangeVariableReferenceNode(rangeVariable.Name, rangeVariable) as SingleValueNode;

// Create a SingleComplexNode for the Location property of the Person entity
var locationProperty = EdmModelBuilder.GetPersonLocationProperty();
var locationProperty = HardCodedTestModel.GetPersonLocationProperty();
var locationNode = new SingleComplexNode(personNode as SingleResourceNode, locationProperty);

// Create the parameters list
Expand Down

0 comments on commit 3d27793

Please sign in to comment.