Ejemplo n.º 1
0
        /// <summary>
        /// Gets the runtime startup task regardless of its order in the startup tasks.
        /// </summary>
        /// <param name="roleStartup">The role startup tasks</param>
        /// <returns>The runtime startup task</returns>
        public static Task GetRuntimeStartupTask(Startup roleStartup)
        {
            if (roleStartup.Task != null)
            {
                return roleStartup.Task.FirstOrDefault<Task>(t =>
                t.commandLine.Equals(Resources.WebRoleStartupTaskCommandLine)
             || t.commandLine.Equals(Resources.WorkerRoleStartupTaskCommandLine));
            }

            return null;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Asserts that given environment variable exists with it's associated value.
 /// </summary>
 /// <param name="roleStartup">The role startup</param>
 /// <param name="variableName">The environment variable name</param>
 /// <param name="expectedValue">The expected value</param>
 public static void ValidateRoleRuntimeVariable(Startup roleStartup, string variableName, string expectedValue)
 {
     string actualValue;
     Assert.IsTrue(TryGetEnvironmentValue(roleStartup.Task, variableName, out actualValue));
     Assert.AreEqual<string>(expectedValue, actualValue);
 }