Skip to content

Commit

Permalink
Updating RemoteRendering SDK to be based on latest API spec and make …
Browse files Browse the repository at this point in the history
…classes more mockable (#18694)

This PR regenerated the SDK based on minor API changes (Azure/azure-rest-api-specs#12920) and makes the classes more mockable.

# All SDK Contribution checklist:

This checklist is used to make sure that common guidelines for a pull request are followed.
- [ ] **Please open PR in `Draft` mode if it is:**
	- Work in progress or not intended to be merged.
	- Encountering multiple pipeline failures and working on fixes.
- [x] If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
- [ ] **I have read the [contribution guidelines](https://github.com/Azure/azure-sdk-for-net/blob/master/CONTRIBUTING.md).**
- [x] **The pull request does not introduce [breaking changes](https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/breaking-change-rules.md).**

### [General Guidelines and Best Practices](https://github.com/Azure/azure-sdk-for-net/blob/master/CONTRIBUTING.md#general-guidelines)
- [x] Title of the pull request is clear and informative.
- [x] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, [see this page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md).

### [Testing Guidelines](https://github.com/Azure/azure-sdk-for-net/blob/master/CONTRIBUTING.md#testing-guidelines)
- [x] Pull request includes test coverage for the included changes.

### [SDK Generation Guidelines](https://github.com/Azure/azure-sdk-for-net/blob/master/CONTRIBUTING.md#sdk-generation-guidelines)
- [] The generate.cmd file for the SDK has been updated with the version of AutoRest, as well as the commitid of your swagger spec or link to the swagger spec, used to generate the code. (Track 2 only)
- [ ] The `*.csproj` and `AssemblyInfo.cs` files have been updated with the new version of the SDK. Please double check nuget.org current release version.

## Additional management plane SDK specific contribution checklist: 
Note: Only applies to `Microsoft.Azure.Management.[RP]` or `Azure.ResourceManager.[RP]`
 
- [ ] Include updated [management metadata](https://github.com/Azure/azure-sdk-for-net/tree/master/eng/mgmt/mgmtmetadata).
- [ ] Update AzureRP.props to add/remove version info to maintain up to date API versions.

### Management plane SDK Troubleshooting
- If this is very first SDK for a services and you are adding new service folders directly under /SDK, please add `new service` label and/or contact assigned reviewer.
- If the check fails at the `Verify Code Generation` step, please ensure:
	- Do not modify any code in generated folders.
	- Do not selectively include/remove generated files in the PR.
	- Do use `generate.ps1/cmd` to generate this PR instead of calling `autorest` directly.
	Please pay attention to the @microsoft.csharp version output after running generate.ps1. If it is lower than current released version (2.3.82), please run it again as it should pull down the latest version,

### Old outstanding PR cleanup
 Please note:
	If PRs (including draft) has been out for more than 60 days and there are no responses from our query or followups, they will be closed to maintain a concise list for our reviewers.
  • Loading branch information
AleksandarTomicMs2 authored Feb 12, 2021
1 parent f222afc commit 8f2c869
Show file tree
Hide file tree
Showing 28 changed files with 202 additions and 163 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Release History

## 1.0.0-beta.2 (Unreleased)
## 1.0.0-beta.3 (Unreleased)

## 1.0.0-beta.2 (2021-02-11)
- Reflect minor REST API improvements.
- Make more classes mockable.

## 1.0.0-beta.1 (2021-02-10)
- Initial version of client.
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,10 @@ public async override ValueTask<Response<AssetConversion>> WaitForCompletionAsyn
}
return _response;
}

/// <summary> Initializes a new instance of AssetConversionOperation for mocking. </summary>
protected AssetConversionOperation()
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace Azure.MixedReality.RemoteRendering
{
/// <summary>
/// Model factory that enables mocking for the Remote Rendering library.
/// </summary>
public static class RemoteRenderingModelFactory
{
/// <summary>
/// Initializes a new instance of the <see cref="AssetConversionOutput"/> class for mocking purposes.
/// </summary>
public static AssetConversionOutput AssetConversionOutput(Uri outputAssetUri)
=> new AssetConversionOutput(outputAssetUri.ToString());

/// <summary>
/// Initializes a new instance of the <see cref="RemoteRenderingServiceError"/> class for mocking purposes.
/// </summary>
public static RemoteRenderingServiceError RemoteRenderingServiceError(string code, string message, IReadOnlyList<RemoteRenderingServiceError> details, string target, RemoteRenderingServiceError innerError)
=> new RemoteRenderingServiceError(code, message, details, target, innerError);

/// <summary>
/// Initializes a new instance of the <see cref="AssetConversion"/> class for mocking purposes.
/// </summary>
public static AssetConversion AssetConversion(string conversionId, AssetConversionOptions options, AssetConversionOutput output, RemoteRenderingServiceError error, AssetConversionStatus status, DateTimeOffset createdOn)
=> new AssetConversion(conversionId, options, output, error, status, createdOn);

/// <summary>
/// Initializes a new instance of the <see cref="RenderingSession"/> class for mocking purposes.
/// </summary>
public static RenderingSession RenderingSession(string sessionId, int? arrInspectorPort, int? handshakePort, int? elapsedTimeMinutes, string host, int? maxLeaseTimeMinutes, RenderingServerSize size, RenderingSessionStatus status, float? teraflops, RemoteRenderingServiceError error, DateTimeOffset? createdOn)
=> new RenderingSession(sessionId, arrInspectorPort, handshakePort, elapsedTimeMinutes, host, maxLeaseTimeMinutes, size, status, teraflops, error, createdOn);
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8f2c869

Please sign in to comment.