public async Task GetPrivateLinkResources()
        {
            //create namespace
            _resourceGroup = await CreateResourceGroupAsync();

            EventHubNamespaceCollection namespaceCollection = _resourceGroup.GetEventHubNamespaces();
            string namespaceName = await CreateValidNamespaceName("testnamespacemgmt");

            EventHubNamespace eventHubNamespace = (await namespaceCollection.CreateOrUpdateAsync(namespaceName, new EventHubNamespaceData(DefaultLocation))).Value;

            //get private link resource
            IReadOnlyList <PrivateLinkResource> privateLinkResources = (await eventHubNamespace.GetPrivateLinkResourcesAsync()).Value;

            Assert.NotNull(privateLinkResources);
        }
Esempio n. 2
0
        public async Task GetPrivateLinkResources()
        {
            //create namespace
            _resourceGroup = await CreateResourceGroupAsync();

            EventHubNamespaceCollection namespaceCollection = _resourceGroup.GetEventHubNamespaces();
            string namespaceName = await CreateValidNamespaceName("testnamespacemgmt");

            EventHubNamespace eventHubNamespace = (await namespaceCollection.CreateOrUpdateAsync(WaitUntil.Completed, namespaceName, new EventHubNamespaceData(DefaultLocation))).Value;

            //get private link resource
            await foreach (var _ in eventHubNamespace.GetPrivateLinkResourcesAsync())
            {
                return;
            }

            Assert.Fail($"{nameof(EventHubNamespace)}.{nameof(EventHubNamespace.GetPrivateLinkResourcesAsync)} has returned an empty collection of {nameof(PrivateLinkResource)}.");
        }