Beispiel #1
0
        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);
        }
Beispiel #2
0
        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");
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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);
        }
Beispiel #6
0
        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);
        }