public void ProducesExpectedArray() { var time64Type = new Time64Type(TimeUnit.Microsecond); var array = new Time64Array.Builder(time64Type) .Append(1_000_000) .Build(); Assert.Equal(1, array.Length); var valueMicroSeconds = array.GetMicroSeconds(0); Assert.NotNull(valueMicroSeconds); Assert.Equal(1_000_000, valueMicroSeconds.Value); var valueNanoSeconds = array.GetNanoSeconds(0); Assert.NotNull(valueNanoSeconds); Assert.Equal(1_000_000_000, valueNanoSeconds.Value); time64Type = new Time64Type(TimeUnit.Nanosecond); array = new Time64Array.Builder(time64Type) .Append(1_000_000_000) .Build(); Assert.Equal(1, array.Length); valueMicroSeconds = array.GetMicroSeconds(0); Assert.NotNull(valueMicroSeconds); Assert.Equal(1_000_000, valueMicroSeconds.Value); valueNanoSeconds = array.GetNanoSeconds(0); Assert.NotNull(valueNanoSeconds); Assert.Equal(1_000_000_000, valueNanoSeconds.Value); }
public void Visit(Time64Type type) { var builder = new Time64Array.Builder(type).Reserve(Length); for (var i = 0; i < Length; i++) { builder.Append(i); } Array = builder.Build(); }