< Summary

Class:Azure.Security.KeyVault.Administration.Models.KeyVaultModelFactory
Assembly:Azure.Security.KeyVault.Administration
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\KeyVaultModelFactory.cs
Covered lines:0
Uncovered lines:17
Coverable lines:17
Total lines:76
Line coverage:0% (0 of 17)
Covered branches:0
Total branches:4
Branch coverage:0% (0 of 4)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
RoleDefinition(...)-0%100%
RoleAssignment(...)-0%100%
RestoreOperation(...)-0%0%
BackupOperation(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\KeyVaultModelFactory.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.Collections.Generic;
 6
 7namespace Azure.Security.KeyVault.Administration.Models
 8{
 9    /// <summary>
 10    /// A factory class which constructs model classes for mocking purposes.
 11    /// </summary>
 12    public static class KeyVaultModelFactory
 13    {
 14        /// <summary>
 15        /// Initializes a new instance of RoleDefinition.
 16        /// </summary>
 17        /// <param name="id"> The role definition ID. </param>
 18        /// <param name="name"> The role definition name. </param>
 19        /// <param name="type"> The role definition type. </param>
 20        /// <param name="roleName"> The role name. </param>
 21        /// <param name="description"> The role definition description. </param>
 22        /// <param name="roleType"> The role type. </param>
 23        /// <param name="permissions"> Role definition permissions. </param>
 24        /// <param name="assignableScopes"> Role definition assignable scopes. </param>
 25        public static RoleDefinition RoleDefinition(string id, string name, string type, string roleName, string descrip
 026            new RoleDefinition(id, name, type, roleName, description, roleType, permissions, assignableScopes);
 27
 28        /// <summary>
 29        /// Initializes a new instance of RoleAssignment.
 30        /// </summary>
 31        /// <param name="id"> The role assignment ID. </param>
 32        /// <param name="name"> The role assignment name. </param>
 33        /// <param name="type"> The role assignment type. </param>
 34        /// <param name="properties"> Role assignment properties. </param>
 35        public static RoleAssignment RoleAssignment(string id, string name, string type, RoleAssignmentPropertiesWithSco
 036            new RoleAssignment(id, name, type, properties);
 37
 38        /// <summary>
 39        /// Initializes a new instance of a FullRestoreOperation for mocking purposes.
 40        /// </summary>
 41        /// <param name="response">The <see cref="Response" /> that will be returned from <see cref="RestoreOperation.Ge
 42        /// <param name="client">An instance of <see cref="KeyVaultBackupClient" />.</param>
 43        /// <param name="id"> Identifier for the restore operation.</param>
 44        /// <param name="startTime"> The start time of the restore operation.</param>
 45        /// <param name="endTime"> The end time of the restore operation.</param>
 46        /// <param name="errorMessage">The error message generated from the operation, if any.</param>
 47        public static RestoreOperation RestoreOperation(Response response, KeyVaultBackupClient client, string id, DateT
 048            new RestoreOperation(new RestoreDetailsInternal(
 049                null,
 050                null,
 051                errorMessage == null ? null : new KeyVaultServiceError(string.Empty, errorMessage, null),
 052                id,
 053                startTime,
 054                endTime), response, client);
 55
 56        /// <summary>
 57        /// Initializes a new instance of a FullBackupOperation for mocking purposes.
 58        /// </summary>
 59        /// <param name="response">The <see cref="Response" /> that will be returned from <see cref="BackupOperation.Get
 60        /// <param name="client">An instance of <see cref="KeyVaultBackupClient" />.</param>
 61        /// <param name="id"> Identifier for the restore operation.</param>
 62        /// <param name="blobContainerUri">The Blob Container Uri containing the backup.</param>
 63        /// <param name="startTime"> The start time of the restore operation.</param>
 64        /// <param name="endTime"> The end time of the restore operation.</param>
 65        /// <param name="errorMessage">The error message generated from the operation, if any.</param>
 66        public static BackupOperation BackupOperation(Response response, KeyVaultBackupClient client, string id, Uri blo
 067            new BackupOperation(new FullBackupDetailsInternal(
 068                null,
 069                null,
 070                errorMessage == null ? null : new KeyVaultServiceError(string.Empty, errorMessage, null),
 071                startTime,
 072                endTime,
 073                id,
 074                blobContainerUri.AbsoluteUri), response, client);
 75    }
 76}