Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactors OpenAPIService tests #1152

Conversation

irvinesunday
Copy link
Contributor

  • Add test to validate we can retrieve all operations and paths.
  • Removes test that validates root path is not present in PowerShell style. We already have a similar test for this:
    [Fact]
    public void ThrowsArgumentExceptionInApplyStyleWhenNoPathsAreReturned()
    {
    var predicate = _openApiService.CreatePredicate(operationIds: null,
    tags: null,
    url: "/",
    source: _graphMockSource,
    graphVersion: GraphVersion); // root path will be non-existent in a PowerShell styled doc.
    var subsetOpenApiDocument = _openApiService.CreateFilteredDocument(_graphMockSource, Title, GraphVersion, predicate);
    // Act & Assert
    var message = Assert.Throws<ArgumentException>(() => _openApiService.ApplyStyle(OpenApiStyle.PowerShell, subsetOpenApiDocument)).Message;
    Assert.Equal("No paths found for the supplied parameters.", message);
    }

Add test to validate we can retrieve all operations and paths. We already have test that validates we do not have the root path for PowerShell style
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@millicentachieng millicentachieng merged commit 5ce2f52 into ma/missing-request-bodies-for-ref-paths Aug 19, 2022
@millicentachieng millicentachieng deleted the patch/is/refactor-tests branch August 19, 2022 11:46
pull bot pushed a commit to ehtick/microsoft-graph-devx-api that referenced this pull request Aug 19, 2022
…1147)

* Remove unnecessary clone when applying OpenAPI style

* Refactor tests (microsoftgraph#1152)

Add test to validate we can retrieve all operations and paths. We already have test that validates we do not have the root path for PowerShell style

* Collapse multiple if conditions into one

Co-authored-by: Irvine Sunday <40403681+irvinesunday@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants