public void TC001_TestStateNoConfigFile() { //Arrange string randomString = Guid.NewGuid().ToString(); //Act State testState = new State(randomString); //Assert Assert.IsNull(testState.Job); Assert.AreEqual(0, testState.Networks.Count); }
public void TC002_TestGetIps() { //Arrange State testState = new State("state.yml"); //Act string test = GetRubyObject(testState.GetValue("properties")); List<string> ips = testState.GetIPs.ToList(); //Assert Assert.AreEqual(1, ips.Count); Assert.AreEqual(ips[0], "10.0.3.132"); }
public void TC006_TestWrite() { //Arrange string newFile = "state_test.yml"; State testState = new State("state.yml"); State newTestState = new State(newFile); StateException exception = null; //Act try { newTestState.Write(testState.ToHash()); } catch (StateException stateException) { exception = stateException; } //Assert Assert.IsNull(exception); Assert.AreEqual(newTestState.Job.Name, testState.Job.Name); }
public void TC005_TestNetworks() { //Arrange State testState = new State("state.yml"); //Act Network network = testState.Networks.First(); //Assert Assert.AreEqual("10.0.3.132", network.IP); Assert.AreEqual("default", network.Name); }
public void TC004_TestValue() { //Arrange State testState = new State("state.yml"); //Act string deployment = ((dynamic)testState.GetValue("deployment")).Value; //Assert Assert.AreEqual("uhuru-cf", deployment); }
public void TC003_TestJob() { //Arrange State testState = new State("state.yml"); //Act Job currentJob = testState.Job; //Assert Assert.AreEqual("win_dea", currentJob.Name); Assert.AreEqual("0.2-dev", currentJob.Version); Assert.AreEqual("cea000d7e5611f3fff6ddbf46163b6a4b025664b", currentJob.SHA1); Assert.AreEqual("win_dea", currentJob.Template); Assert.AreEqual("c9034ac9-ffc1-4aff-b17a-9be8533a6bfa", currentJob.BlobstoreId); }