Exemplo n.º 1
0
            public void Visit(Date32Type actualType)
            {
                Assert.IsAssignableFrom <Date32Type>(_expectedType);
                var expectedType = (Date32Type)_expectedType;

                Assert.Equal(expectedType.Unit, actualType.Unit);
            }
Exemplo n.º 2
0
 public void Visit(Date32Type actualType)
 {
     if (_expectedType is Date32Type expectedType &&
         expectedType.Unit == actualType.Unit)
     {
         _dataTypeMatch = true;
     }
 }
Exemplo n.º 3
0
            public void Visit(Date32Type type)
            {
                var builder = new Date32Array.Builder().Reserve(Length);
                var basis   = DateTimeOffset.UtcNow.AddDays(-Length);

                for (var i = 0; i < Length; i++)
                {
                    builder.Append(basis.AddDays(i));
                }

                Array = builder.Build();
            }
Exemplo n.º 4
0
            public void Visit(Date32Type type)
            {
                var builder = new Date32Array.Builder().Reserve(Length);

                // Length can be greater than the number of days since DateTime.MinValue.
                // Set a cap for how many days can be subtracted from now.
                int maxDays = Math.Min(Length, 100_000);
                var basis   = DateTimeOffset.UtcNow.AddDays(-maxDays);

                for (var i = 0; i < Length; i++)
                {
                    builder.Append(basis.AddDays(i % maxDays));
                }

                Array = builder.Build();
            }
 public void Visit(Date32Type type)
 {
     Result = FieldType.Build(
         Flatbuf.Type.Date,
         Flatbuf.Date.CreateDate(Builder, DateUnit.DAY));
 }
 public void Visit(Date32Type type) => GenerateTestData <DateTime, Date32Array, Date32Array.Builder>(type, x => DateTime.MinValue.AddDays(x));
Exemplo n.º 7
0
 public void Visit(Date32Type type) => CreateNumberArray <int>(type);
Exemplo n.º 8
0
 public void Visit(Date32Type type)
 {
     throw new NotImplementedException();
 }