public void TestGrowableArray() { WordIdMapCompiler.GrowableIntArray array = new WordIdMapCompiler.GrowableIntArray(5); array.Set(3, 1); Assert.AreEqual("[0, 0, 0, 1]", array.GetArray().Array2String()); array.Set(0, 2); array.Set(10, 3); Assert.AreEqual("[2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 3]", array.GetArray().Array2String()); }
public void TestGrowableArray() { var array = new WordIdMapCompiler.GrowableIntArray(5); array[3] = 1; string.Join(", ", array.GetArray()).Is("0, 0, 0, 1"); array[0] = 2; array[10] = 3; string.Join(", ", array.GetArray()).Is("2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 3"); }