internal void AddFieldValue(object value) { if (value is int || value is long || value is double) { if (NumericValues == null) { NumericValues = new List <double>(); } NumericValues.Add(Convert.ToDouble(value)); FieldType = FieldType.Number; } else if (value is DateTime) { if (DateTimeValues == null) { DateTimeValues = new List <DateTime>(); } DateTimeValues.Add((DateTime)value); FieldType = FieldType.Date; } else { if (Values == null) { Values = new List <string>(); } Values.Add(value.ToString()); FieldType = FieldType.Text; } }
public void Add_GivenTwoIntValues_Returns_Int() { //Arrange var myNumbers = new NumericValues(); //Act var result = myNumbers.Add(1, 2); //Assert Assert.Equal(3, result); }