public void ListVar_TestRandomGenerateAutoValueNotExists() { //Arrange List <string> lstTemp = new List <string>(); VariableList variableList = new VariableList("TestList", lstTemp); variableList.RandomOrder = true; //Act variableList.GenerateAutoValue(); //Assert Assert.IsFalse(lstTemp.Contains("Dummy"), "Random GenerateAutoValue"); }
public void ListVar_TestRandomGenerateAutoValue() { //Arrange List <string> lstTemp = new List <string>(); lstTemp.Add("Jupiter"); lstTemp.Add("Saturn"); VariableList variableList = new VariableList("TestList", lstTemp); variableList.RandomOrder = true; //Act variableList.GenerateAutoValue(); string strValue = variableList.Value; //Assert Assert.IsTrue(lstTemp.Contains(strValue), "Random GenerateAutoValue"); }
public void ListVar_TestGenerateAutoValue() { //Arrange List <string> lstTemp = new List <string>(); lstTemp.Add("Apple"); lstTemp.Add("Blue"); lstTemp.Add("Green"); lstTemp.Add("Yellow"); VariableList variableList = new VariableList("TestList", lstTemp); //Act variableList.RandomOrder = false; variableList.GenerateAutoValue(); string strValue = variableList.Value; //Assert Assert.AreEqual("Apple", strValue, "GenerateAutoValue"); }
public void ListVar_TestGenerateAutoValuesSequence() { //Arrange List <string> lstTemp = new List <string>(); lstTemp.Add("Apple"); lstTemp.Add("Blue"); lstTemp.Add("Green"); lstTemp.Add("Yellow"); VariableList variableList = new VariableList("TestList", lstTemp); variableList.RandomOrder = false; for (int iVar = 0; iVar < lstTemp.Count; iVar++) { //Act variableList.GenerateAutoValue(); string strValue = variableList.Value; //Assert Assert.AreEqual(lstTemp[iVar], strValue, "GenerateAutoValue"); } }