public void NoInstallTest() { Terraform tool = new Terraform(); string version = tool.GetActiveVersion(); Assert.IsNull(version); }
public static async void TestConstruction() { var provider = new Azure() { ClientId = "abc", ClientSecret = "123", TenantId = "", SubscriptionId = "" }; ILoggerFactory loggerFactory = LoggerFactory.Create(builder => builder.AddDebug()); ILogger logger = loggerFactory.CreateLogger <UnitTests>(); var terraform = new Terraform() { Path = new DirectoryInfo(Path.GetTempPath()), DryRun = true }; terraform.Providers.Add(provider); terraform.Vars.Add("adam2", new List <string>() { "how", "many", "is", "this" }); var configValues = provider.GetConfig(); var result = await terraform.Plan(logger); Assert.Equal("terraform plan -var='adam2=[\"how\",\"many\",\"is\",\"this\"]'", result, ignoreWhiteSpaceDifferences: true); }
public void InstallOneWithActivateTest() { Terraform tool = new Terraform("0.11.0"); tool.Install(true); Assert.AreEqual("0.11.0", tool.GetActiveVersion()); }
public void ReinstallTest() { Terraform tool = new Terraform("0.11.1"); tool.Install(true); tool.Install(true); string version = tool.GetRawVersion(); Assert.AreEqual("0.11.1", tool.GetActiveVersion()); }
public void InstallWithoutActivateTest() { Terraform firstTool = new Terraform("0.11.0"); firstTool.Install(true); Terraform secondTool = new Terraform("0.11.1"); secondTool.Install(); Assert.AreEqual("0.11.0", firstTool.GetActiveVersion()); Assert.AreEqual("0.11.0", secondTool.GetActiveVersion()); }
public void GetVersions() { string[] versionInstalls = new string[] { "0.11.2", "0.11.3" }; foreach (string versionInstall in versionInstalls) { Terraform tool = new Terraform(versionInstall); tool.Install(); } Terraform testTool = new Terraform(); Assert.AreEqual(versionInstalls.Length, testTool.AllVersions.Count); }
public void ElevateSlot(int triIndex, RaycastHit hit, float ratio, int size) { int index = int.Parse(hit.transform.name.Replace("face ", "")); Debug.Log(index); int pos = textureFaces[index].mesh.triangles[triIndex * 3]; Sommet s = textureFaces[index].Sommets[pos]; Terraform.Elevate(s, ratio); foreach (Sommet s2 in s.pointsAdjacents) { Terraform.Elevate(s2, (1 + ratio) / 2); } }
static void Main() { var provider = new Azure() { ClientId = "xxxx", ClientSecret = "xxxx", TenantId = "xxxx", SubscriptionId = "xxxx" }; ILoggerFactory loggerFactory = LoggerFactory.Create(builder => builder.AddConsole()); ILogger logger = loggerFactory.CreateLogger <Program>(); var tf = new Terraform(); tf.Providers.Add(provider); var configValues = provider.GetConfig(); logger.LogInformation(tf.Init(logger).Result); logger.LogInformation(tf.Validate(logger).Result); logger.LogInformation(tf.Plan(logger).Result); logger.LogInformation(tf.Apply(logger).Result); logger.LogInformation(tf.Destroy(logger).Result); }
public void InvalidVersionTest() { Terraform tool = new Terraform("2.0.0"); tool.Install(); }
public void Initialize() { Terraform terraform = new Terraform(); terraform.UninstallAll(); }
public void Cleanup() { Terraform terraform = new Terraform(); terraform.UninstallAll(); }
void Start() { resourceStats = GameObject.Find("Manager").GetComponent <ResorceManager>(); TerraformStats = GameObject.Find("Dome").GetComponent <Terraform>(); }
void Awake() { GameObject TerraformButt = GameObject.Find("Terraform"); terraformScript = TerraformButt.GetComponent <Terraform>(); }
void OnGUI() { if (GUI.Button(new Rect(Screen.width / 2 - 110, 10, btnW, btnH), "Zoom in")) { Game.Zoom *= 0.8f; } if (GUI.Button(new Rect(Screen.width / 2 + 10, 10, btnW, btnH), "Zoom out")) { Game.Zoom /= 0.8f; } var ot = overlayNames[Game.DataOverlay]; if (GUI.Button(new Rect(Screen.width / 2 + 120, 10, btnW, btnH), ot)) { Game.DataOverlay = (Game.DataOverlay + 1) % 4; } if (Game.SelectedBuilding == null) { var terraform = new Terraform { Game = Game }; if (GUI.Button(new Rect(10, 10, btnW, btnH), "Level")) { terraform.LevelTerrain(Game.SelectedCell, Game.CursorSize); } if (GUI.Button(new Rect(10, 20 + btnH, btnW, btnH), "Raise")) { terraform.AdjustTerrain(Game.SelectedCell, Game.CursorSize, 0.25f); } if (GUI.Button(new Rect(10, 30 + btnH * 2, btnW, btnH), "Lower")) { terraform.AdjustTerrain(Game.SelectedCell, Game.CursorSize, -0.25f); } } else { if (GUI.Button(new Rect(10, 10, btnW, btnH), "Toggle")) { Game.SelectedBuilding.IsEnabled = !Game.SelectedBuilding.IsEnabled; } } if (GUI.Button(new Rect(10, 40 + btnH * 3, btnW / 3, btnH), "1x")) { Game.CursorSize = 1; } if (GUI.Button(new Rect(10 + btnW / 3, 40 + btnH * 3, btnW / 3, btnH), "2x")) { Game.CursorSize = 2; } if (GUI.Button(new Rect(10 + 2 * btnW / 3, 40 + btnH * 3, btnW / 3, btnH), "3x")) { Game.CursorSize = 3; } var dh = btnH + padding; if (Game.Buildings.Count == 0) { var didClick = GUI.Button(new Rect(10, 4 * dh, btnW, btnH), "Hub"); if (didClick) { InputFilter.AbortTap(); Game.AddBuilding(Definitions.hub, Game.SelectedCell); } } else if (Game.NeighbourDist[Game.SelectedCell] <= Game.BuildRange) { var i = 0; foreach (var type in Definitions.types.Where(t => t.w == Game.CursorSize)) { if (type.Predicate.CanBuild(type, Game.SelectedCell, Game)) { i++; var y = 3 * dh + dh * i; var didClick = GUI.Button(new Rect(10, y, btnW, btnH), type.name); if (didClick) { InputFilter.AbortTap(); Game.AddBuilding(type, Game.SelectedCell); } } } } }