< Summary

Class:Microsoft.Azure.Management.Search.Tests.OperationsTests
Assembly:Search.Management.Tests
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Management.Search\tests\Tests\OperationsTests.cs
Covered lines:0
Uncovered lines:116
Coverable lines:116
Total lines:134
Line coverage:0% (0 of 116)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ListOperationsReturnsExpectedOperations()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Management.Search\tests\Tests\OperationsTests.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License. See License.txt in the project root for
 3// license information.
 4
 5namespace Microsoft.Azure.Management.Search.Tests
 6{
 7    using System.Linq;
 8    using Microsoft.Azure.Management.Search.Models;
 9    using Microsoft.Azure.Search.Tests.Utilities;
 10    using Xunit;
 11
 12    public sealed class OperationsTests : SearchTestBase<ResourceGroupFixture>
 13    {
 14        [Fact]
 15        public void ListOperationsReturnsExpectedOperations()
 16        {
 017            Run(() =>
 018            {
 019                SearchManagementClient searchMgmt = GetSearchManagementClient();
 020
 021                var expectedCoreOperations = new[]
 022                {
 023                    new Operation(
 024                        name: "Microsoft.Search/register/action",
 025                        display: new OperationDisplay(
 026                            provider: "Microsoft Search",
 027                            operation: "Register the Search Resource Provider",
 028                            resource: "Search Services",
 029                            description: "Registers the subscription for the search resource provider and enables the cr
 030                    new Operation(
 031                        name: "Microsoft.Search/searchServices/write",
 032                        display: new OperationDisplay(
 033                            provider: "Microsoft Search",
 034                            resource: "Search Services",
 035                            operation: "Set Search Service",
 036                            description: "Creates or updates the search service.")),
 037                    new Operation(
 038                        name: "Microsoft.Search/searchServices/read",
 039                        display: new OperationDisplay(
 040                            provider: "Microsoft Search",
 041                            resource: "Search Services",
 042                            operation: "Get Search Service",
 043                            description: "Reads the search service.")),
 044                    new Operation(
 045                        name: "Microsoft.Search/searchServices/delete",
 046                        display: new OperationDisplay(
 047                            provider: "Microsoft Search",
 048                            resource: "Search Services",
 049                            operation: "Delete Search Service",
 050                            description: "Deletes the search service.")),
 051                    new Operation(
 052                        name: "Microsoft.Search/searchServices/listAdminKeys/action",
 053                        display: new OperationDisplay(
 054                            provider: "Microsoft Search",
 055                            resource: "Search Services",
 056                            operation: "Get Admin Key",
 057                            description: "Reads the admin keys.")),
 058                    new Operation(
 059                        name: "Microsoft.Search/searchServices/regenerateAdminKey/action",
 060                        display: new OperationDisplay(
 061                            provider: "Microsoft Search",
 062                            resource: "Search Services",
 063                            operation: "Regenerate Admin Key",
 064                            description: "Regenerates the admin key.")),
 065                    new Operation(
 066                        name: "Microsoft.Search/searchServices/listQueryKeys/action",
 067                        display: new OperationDisplay(
 068                            provider: "Microsoft Search",
 069                            resource: "API Keys",
 070                            operation: "Get Query Keys",
 071                            description: "Returns the list of query API keys for the given Azure Search service.")),
 072                    new Operation(
 073                        name: "Microsoft.Search/searchServices/createQueryKey/action",
 074                        display: new OperationDisplay(
 075                            provider: "Microsoft Search",
 076                            resource: "Search Services",
 077                            operation: "Create Query Key",
 078                            description: "Creates the query key.")),
 079                    new Operation(
 080                        name: "Microsoft.Search/searchServices/deleteQueryKey/delete",
 081                        display: new OperationDisplay(
 082                            provider: "Microsoft Search",
 083                            resource: "API Keys",
 084                            operation: "Delete Query Key",
 085                            description: "Deletes the query key.")),
 086                    new Operation(
 087                        name: "Microsoft.Search/checkNameAvailability/action",
 088                        display: new OperationDisplay(
 089                            provider: "Microsoft Search",
 090                            resource: "Service Name Availability",
 091                            operation: "Check Service Name Availability",
 092                            description: "Checks availability of the service name.")),
 093                    new Operation(
 094                        name: "Microsoft.Search/searchServices/privateEndpointConnectionProxies/validate/action",
 095                        display: new OperationDisplay(
 096                            provider: "Microsoft Search",
 097                            resource: "Private Endpoint Connection Proxy",
 098                            operation: "Validate Private Endpoint Connection Proxy",
 099                            description: "Validates a private endpoint connection create call from NRP side")),
 0100                    new Operation(
 0101                        name: "Microsoft.Search/searchServices/privateEndpointConnectionProxies/write",
 0102                        display: new OperationDisplay(
 0103                            provider: "Microsoft Search",
 0104                            resource: "Private Endpoint Connection Proxy",
 0105                            operation: "Create Private Endpoint Connection Proxy",
 0106                            description: "Creates a private endpoint connection proxy with the specified parameters or u
 0107                    new Operation(
 0108                        name: "Microsoft.Search/searchServices/privateEndpointConnectionProxies/read",
 0109                        display: new OperationDisplay(
 0110                            provider: "Microsoft Search",
 0111                            resource: "Private Endpoint Connection Proxy",
 0112                            operation: "Get Private Endpoint Connection Proxy",
 0113                            description: "Returns the list of private endpoint connection proxies or gets the properties
 0114                    new Operation(
 0115                        name: "Microsoft.Search/searchServices/privateEndpointConnectionProxies/delete",
 0116                        display: new OperationDisplay(
 0117                            provider: "Microsoft Search",
 0118                            resource: "Private Endpoint Connection Proxy",
 0119                            operation: "Delete Private Endpoint Connection Proxy",
 0120                            description: "Deletes an existing private endpoint connection proxy"))
 0121                };
 0122
 0123                Operation[] actualOperations = searchMgmt.Operations.List().ToArray();
 0124
 0125                // There may be more operations than just the core ones expected by this test, but we don't
 0126                // want to break SDK tests every time we add a new operation.
 0127                foreach (Operation expectedCoreOperation in expectedCoreOperations)
 0128                {
 0129                    Assert.Contains(expectedCoreOperation, actualOperations, new ModelComparer<Operation>());
 0130                }
 0131            });
 0132        }
 133    }
 134}