public void CanAddRoleCollectionToScriptAction() { var config = new AzureHDInsightConfig(); IAddAzureHDInsightScriptActionCommand scriptActionCommand = ServiceLocator.Instance.Locate <IAzureHDInsightCommandFactory>().CreateAddScriptAction(); scriptActionCommand.ClusterRoleCollection = new ClusterNodeType[] { ClusterNodeType.HeadNode, ClusterNodeType.DataNode }; scriptActionCommand.Name = "test"; scriptActionCommand.Uri = new Uri("http://test.com"); scriptActionCommand.Parameters = "test parameters"; scriptActionCommand.Config = config; scriptActionCommand.EndProcessing(); AzureHDInsightConfig newConfig = scriptActionCommand.Output.First(); Assert.AreEqual(config.ClusterSizeInNodes, newConfig.ClusterSizeInNodes); Assert.AreEqual(config.DefaultStorageAccount, newConfig.DefaultStorageAccount); Assert.IsTrue(config.ConfigActions.Count == newConfig.ConfigActions.Count && config.ConfigActions.Count == 1); Assert.IsTrue(newConfig.ConfigActions.ElementAt(0) is AzureHDInsightScriptAction); Assert.IsTrue(newConfig.ConfigActions.ElementAt(0).Name == "test" && ((AzureHDInsightScriptAction)newConfig.ConfigActions.ElementAt(0)).Uri == new Uri("http://test.com") && ((AzureHDInsightScriptAction)newConfig.ConfigActions.ElementAt(0)).Parameters == "test parameters"); Assert.IsTrue(Enumerable.SequenceEqual(newConfig.ConfigActions.ElementAt(0).ClusterRoleCollection, new ClusterNodeType[] { ClusterNodeType.HeadNode, ClusterNodeType.DataNode })); }
public void CanAddComplexScriptAction() { var config = new AzureHDInsightConfig(); IAddAzureHDInsightScriptActionCommand scriptActionCommand = ServiceLocator.Instance.Locate <IAzureHDInsightCommandFactory>().CreateAddScriptAction(); scriptActionCommand.ClusterRoleCollection = new ClusterNodeType[] { ClusterNodeType.HeadNode }; scriptActionCommand.Config = config; scriptActionCommand.EndProcessing(); AzureHDInsightConfig newConfig = scriptActionCommand.Output.First(); Assert.AreEqual(config.ClusterSizeInNodes, newConfig.ClusterSizeInNodes); Assert.AreEqual(config.DefaultStorageAccount, newConfig.DefaultStorageAccount); Assert.IsTrue(config.ConfigActions.Count == newConfig.ConfigActions.Count && config.ConfigActions.Count == 1); Assert.IsTrue(newConfig.ConfigActions.ElementAt(0) is AzureHDInsightScriptAction); Assert.IsTrue(Enumerable.SequenceEqual(newConfig.ConfigActions.ElementAt(0).ClusterRoleCollection, new ClusterNodeType[] { ClusterNodeType.HeadNode })); }
/// <summary> /// Initializes a new instance of the AddAzureHDInsightMetastoreCmdlet class. /// </summary> public AddAzureHDInsightScriptActionCmdlet() { this.command = ServiceLocator.Instance.Locate<IAzureHDInsightCommandFactory>().CreateAddScriptAction(); }
/// <summary> /// Initializes a new instance of the AddAzureHDInsightMetastoreCmdlet class. /// </summary> public AddAzureHDInsightScriptActionCmdlet() { this.command = ServiceLocator.Instance.Locate <IAzureHDInsightCommandFactory>().CreateAddScriptAction(); }