public static void VerifyWorkerRole(ServiceDefinitionSchema.WorkerRole role, bool isForwarder)
 {
     Assert.AreEqual(isForwarder ? 1 : 0, role.Imports.Where(i => i.moduleName == "RemoteForwarder").Count());
     Assert.AreEqual(1, role.Imports.Where(i => i.moduleName == "RemoteAccess").Count());
 }
 /// <summary>
 /// Validates that given service definition is valid against list of web/worker roles. Validation steps:
 /// 1. Make sure that name element 
 /// </summary>
 /// <param name="actual">Service definition to be checked</param>
 /// <param name="serviceName">New created service name</param>
 public static void IsValidServiceDefinition(ServiceDefinitionSchema.ServiceDefinition actual, string serviceName)
 {
     Assert.AreEqual<string>(serviceName, actual.name);
     Assert.IsNull(actual.WebRole);
     Assert.IsNull(actual.WorkerRole);
 }
        /// <summary>
        /// Return the value for the specified setting, if it exists in the given runtime environment
        /// </summary>
        /// <param name="environment">The runtime environment to search</param>
        /// <param name="key">The name of the setting</param>
        /// <param name="value">The value of the setting, if it is found, null otherwise</param>
        /// <returns>true if the setting is found in the given environment</returns>
        private bool TryGetEnvironmentValue(ServiceDefinitionSchema.Variable[] environment, string key, out string value)
        {
            value = null;
            bool found = false;
            if (environment != null)
            {
                foreach (ServiceDefinitionSchema.Variable setting in environment)
                {
                    if (string.Equals(setting.name, key, StringComparison.OrdinalIgnoreCase))
                    {
                        value = setting.value;
                        found = true;
                    }
                }
            }

            return found;
        }
 public static void AreEqualServiceDefinition(ServiceDefinitionSchema.ServiceDefinition expected, ServiceDefinitionSchema.ServiceDefinition actual)
 {
     throw new NotImplementedException();
 }