public async Task PrivateEndpointConnectionDelete() { await CreatePrivateEndpoint(); var privateEndpointConnections = await PrivateEndpointConnectionCollection.GetAllAsync().ToEnumerableAsync(); var name = privateEndpointConnections[0].Data.Name; Assert.IsTrue(await PrivateEndpointConnectionCollection.ExistsAsync(name)); var id = PrivateEndpointConnectionCollection.Id; id = CosmosDBPrivateEndpointConnectionResource.CreateResourceIdentifier(id.SubscriptionId, id.ResourceGroupName, id.Name, name); var privateEndpointConnection = this.ArmClient.GetCosmosDBPrivateEndpointConnectionResource(id); await privateEndpointConnection.DeleteAsync(WaitUntil.Completed); bool exists = await PrivateEndpointConnectionCollection.ExistsAsync(name); Assert.IsFalse(exists); }
private void VerifyPrivateEndpointConnections(PrivateLinkServiceConnection expectedValue, CosmosDBPrivateEndpointConnectionResource actualValue) { // Services will give diffferent ids and names for the incoming private endpoint connections, so comparing them is meaningless //Assert.AreEqual(expectedValue.Id, actualValue.Id); //Assert.AreEqual(expectedValue.Name, actualValue.Data.Name); Assert.AreEqual(expectedValue.ConnectionState.Status, actualValue.Data.ConnectionState.Status); Assert.AreEqual(expectedValue.ConnectionState.Description, actualValue.Data.ConnectionState.Description); Assert.AreEqual(expectedValue.ConnectionState.ActionsRequired, actualValue.Data.ConnectionState.ActionsRequired); }