OData / odata.net

ODataLib: Open Data Protocol - .NET Libraries and Frameworks
https://docs.microsoft.com/odata
Other
675 stars 348 forks source link

Port ActionOverloadingTests, AnnotationTests and AsyncRequestTests #3005

Open ElizabethOkerio opened 2 weeks ago

ElizabethOkerio commented 2 weeks ago

Issues

This pull request fixes #xxx.

Description

This PR ports the ActionOverloadingTests, AnnotationTests and AsyncRequestTests from using WCF services to use Microsoft.AspNetCore.OData

The ActionOverloading tests test action overloading. Action Overloading is where we have several actions with the same name but with different binding parameters.

The AnnotationTests tests the use of custom annotations and how users can add annotations to their model classes. Microsoft.AspNetCore.OData does not have a way for customers to add annotations to their model classes. There is on-going work to add support for this. These tests will be enabled once we have a way of adding these annotations when creating OData APIs.

The AsyncRequestsTests test the use of the Prefer header Respond-Async. More info on what this prefer-header is here: https://docs.oasis-open.org/odata/odata/v4.01/cs01/part1-protocol/odata-v4.01-cs01-part1-protocol.html#sec_AsynchronousRequests.

The structure of these tests will be: We'll have folders for the various scenarios that we are testing just like is in the current set-up. For example for the above tests: We have folders named:

  1. ActionOverloadingTests
  2. AnnotationsTests
  3. AsyncRequestsTests

These folders will contain 3 sub-folders:

  1. Server - This server folder will contain the controllers, EdmModels, DataSources and Data Model classes that will be used to create the OData APIs.
  2. Client - This folder will contain proxy classes for the EdmModel that's used by all the services in that particular folder. Using OData Connected Service to generate the proxy classes. It is this generated class that will be used to create an instance of the DataServiceContext that will be used to communicate the various OData endpoints.
  3. Tests - This folder will contain all tests classes that contain tests for the particular scenario that we're testing.

I've added a Common folder in Microsoft.OData.Client.E2E.Tests.csproj that will have a common DataModel and Data Source for some test scenarios that might share the various Model classes or Data Sources.

Checklist (Uncheck if it is not completed)

Additional work necessary

If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.