Ejemplo n.º 1
0
        public async Task ListSecurityGroups()
        {
            var groups = await _networkingService.ListSecurityGroupsAsync(new SecurityGroupListOptions { Name = "default" });

            Assert.NotEmpty(groups);

            var defaultGroup = groups.First();

            Assert.NotNull(defaultGroup);
            Assert.NotNull(defaultGroup.Name);
            Assert.NotNull(defaultGroup.Description);
            Assert.NotNull(defaultGroup.Id);
            Assert.NotEmpty(defaultGroup.SecurityGroupRules);

            var defaultRule = defaultGroup.SecurityGroupRules.First();

            Assert.NotNull(defaultRule.Id);
            Assert.NotNull(defaultRule.Direction);
            Assert.NotNull(defaultRule.Ethertype);
            Assert.NotNull(defaultRule.SecurityGroupId);
        }
        public async Task ListSecurityGroups()
        {
            var groups = await _networkingService.ListSecurityGroupsAsync(new SecurityGroupListOptions { Name = "default" });

            Assert.NotEmpty(groups);

            var defaultGroup = groups.First();

            Assert.NotNull(defaultGroup);
            Assert.NotNull(defaultGroup.Name);
            Assert.NotNull(defaultGroup.Description);
            Assert.NotNull(defaultGroup.Id);
            Assert.NotEmpty(defaultGroup.SecurityGroupRules);

            var defaultRule = defaultGroup.SecurityGroupRules.First();

            Assert.NotNull(defaultRule.Id);
            Assert.NotNull(defaultRule.Direction);
#pragma warning disable xUnit2002 // Do not use null check on value type
            Assert.NotNull(defaultRule.Ethertype);
#pragma warning restore xUnit2002 // Do not use null check on value type
            Assert.NotNull(defaultRule.SecurityGroupId);
        }
 /// <inheritdoc cref="NetworkingService_Layer3_Extensions.ListSecurityGroupsAsync" />
 public static IEnumerable <SecurityGroup> ListSecurityGroups(this NetworkingService service, SecurityGroupListOptions options = null)
 {
     return(service.ListSecurityGroupsAsync(options).ForceSynchronous());
 }