Ejemplo n.º 1
0
 static void IsRequiredType(int index, SandboxResourceLight resource, string[] expectedVms = null)
 {
     if (index < SandboxExpectedResources.Length)
     {
         Assert.Equal(SandboxExpectedResources[index], resource.Type);
     }
     else if (expectedVms != null && expectedVms.Length > 0)
     {
         Assert.Equal(AzureResourceTypeFriendlyName.VirtualMachine, resource.Type);
         Assert.Equal(expectedVms[index - SandboxExpectedResources.Length], resource.Name);
     }
 }
        public Dictionary <string, string> Resolve(CloudResource source, SandboxResourceLight destination, Dictionary <string, string> destMember, ResolutionContext context)
        {
            if (source != null)
            {
                if (source.ResourceType == AzureResourceType.VirtualMachine)
                {
                    if (VmRuleUtils.InternetIsOpen(source))
                    {
                        return(new Dictionary <string, string>()
                        {
                            { "InternetIsOpen", "true" }
                        });
                    }
                }
            }

            return(null);
        }