/// <summary> /// Gets or sets the <see cref="CsvCell" /> at the specified column name, represented as an Excel column name (like A, B, ... AA, AB, ...). /// </summary> /// <param name="column">A <see cref="string" /> specifying the one-based column index, represented as an Excel column name (like A, B, ... AA, AB, ...).</param> public CsvCell this[string column] { get { Check.ArgumentNull(column, nameof(column)); Check.ArgumentEx.StringNotEmpty(column, nameof(column)); return(this[ConvertEx.FromExcelColumnString(column)]); } set { Check.ArgumentNull(column, nameof(column)); Check.ArgumentEx.StringNotEmpty(column, nameof(column)); this[ConvertEx.FromExcelColumnString(column)] = value; } }
public void BytecodeApi_ConvertEx() { byte[] data = MathEx.RandomNumberGenerator.GetBytes(100); Assert.IsTrue(ConvertEx.FromHexadecimalString(ConvertEx.ToHexadecimalString(data)).Compare(data)); Assert.IsTrue(ConvertEx.FromBase32String(ConvertEx.ToBase32String(data)).Compare(data)); for (int i = 0; i < 1000; i++) { Assert.AreEqual(ConvertEx.FromExcelColumnString(ConvertEx.ToExcelColumnString(i)), i); Assert.AreEqual(ConvertEx.From7BitEncodedInt(ConvertEx.To7BitEncodedInt(i)), i); } for (int i = 1; i <= 3999; i++) { Assert.AreEqual(ConvertEx.FromRomanNumber(ConvertEx.ToRomanNumber(i)), i); } Point point = ConvertEx.ToStructure <Point>(ConvertEx.FromStructure(new Point(1337, 4242))); Assert.IsTrue(point.X == 1337 && point.Y == 4242); }