public void DefaultIndexBuilderLong() { var number = 12345678901L; var builder = new NumericIndexBuilder<long>(); var level0Index = builder.Build(number, 0); Assert.Equal(new int[] { }, level0Index); var level1Index = builder.Build(number, 1); Assert.Equal(new[] { 1 }, level1Index); var level3Index = builder.Build(number, 3); Assert.Equal(new[] { 1, 2, 3 }, level3Index); var level10Index = builder.Build(number, 10); Assert.Equal(new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 }, level10Index); }
public void DefaultIndexBuilderByte() { var number = (byte)123; var builder = new NumericIndexBuilder<byte>(); var level0Index = builder.Build(number, 0); Assert.Equal(new int[] { }, level0Index); var level1Index = builder.Build(number, 1); Assert.Equal(new[] { 1 }, level1Index); var level3Index = builder.Build(number, 3); Assert.Equal(new[] { 1, 2, 3 }, level3Index); var level10Index = builder.Build(number, 10); Assert.Equal(new[] { 1, 2, 3 }, level10Index); }
public void DefaultIndexBuilderInt32() { var number = 1234; var builder = new NumericIndexBuilder<int>(); var level0Index = builder.Build(number, 0); Assert.Equal(new int[] { }, level0Index); var level1Index = builder.Build(number, 1); Assert.Equal(new[] { 1 }, level1Index); var level3Index = builder.Build(number, 3); Assert.Equal(new[] { 1, 2, 3 }, level3Index); var level10Index = builder.Build(number, 10); Assert.Equal(new[] { 1, 2, 3, 4 }, level10Index); }
public void DefaultIndexBuilderLong() { var number = 12345678901L; var builder = new NumericIndexBuilder <long>(); var level0Index = builder.Build(number, 0); Assert.Equal(new int[] { }, level0Index); var level1Index = builder.Build(number, 1); Assert.Equal(new[] { 1 }, level1Index); var level3Index = builder.Build(number, 3); Assert.Equal(new[] { 1, 2, 3 }, level3Index); var level10Index = builder.Build(number, 10); Assert.Equal(new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 }, level10Index); }
public void DefaultIndexBuilderInt32() { var number = 1234; var builder = new NumericIndexBuilder <int>(); var level0Index = builder.Build(number, 0); Assert.Equal(new int[] { }, level0Index); var level1Index = builder.Build(number, 1); Assert.Equal(new[] { 1 }, level1Index); var level3Index = builder.Build(number, 3); Assert.Equal(new[] { 1, 2, 3 }, level3Index); var level10Index = builder.Build(number, 10); Assert.Equal(new[] { 1, 2, 3, 4 }, level10Index); }
public void DefaultIndexBuilderNegativeInt32() { var number = -1234; var builder = new NumericIndexBuilder <int>(); var level0Index = builder.Build(number, 0); Assert.Equal(new int[] {}, level0Index); var level1Index = builder.Build(number, 1); Assert.Equal(new[] { NumericIndices.MinusPosition }, level1Index); var level3Index = builder.Build(number, 3); Assert.Equal(new[] { NumericIndices.MinusPosition, 1, 2 }, level3Index); var level10Index = builder.Build(number, 10); Assert.Equal(new[] { NumericIndices.MinusPosition, 1, 2, 3, 4 }, level10Index); }
public void DefaultIndexBuilderNegativeLong() { var number = -12345678901L; var builder = new NumericIndexBuilder <long>(); var level0Index = builder.Build(number, 0); Assert.Equal(new int[] {}, level0Index); var level1Index = builder.Build(number, 1); Assert.Equal(new[] { NumericIndices.MinusPosition }, level1Index); var level3Index = builder.Build(number, 3); Assert.Equal(new[] { NumericIndices.MinusPosition, 1, 2 }, level3Index); var level10Index = builder.Build(number, 10); Assert.Equal(new[] { NumericIndices.MinusPosition, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, level10Index); }
public void DefaultIndexBuilderNegativeSByte() { var number = (sbyte)-123; var builder = new NumericIndexBuilder <sbyte>(); var level0Index = builder.Build(number, 0); Assert.Equal(new int[] { }, level0Index); var level1Index = builder.Build(number, 1); Assert.Equal(new[] { NumericIndices.MinusPosition }, level1Index); var level3Index = builder.Build(number, 3); Assert.Equal(new[] { NumericIndices.MinusPosition, 1, 2 }, level3Index); var level10Index = builder.Build(number, 10); Assert.Equal(new[] { NumericIndices.MinusPosition, 1, 2, 3 }, level10Index); }
public void DefaultIndexBuilderSByte() { var number = (sbyte)123; var builder = new NumericIndexBuilder <sbyte>(); var level0Index = builder.Build(number, 0); Assert.Equal(new int[] { }, level0Index); var level1Index = builder.Build(number, 1); Assert.Equal(new[] { 1 }, level1Index); var level3Index = builder.Build(number, 3); Assert.Equal(new[] { 1, 2, 3 }, level3Index); var level10Index = builder.Build(number, 10); Assert.Equal(new[] { 1, 2, 3 }, level10Index); }
public void DefaultIndexBuilderUInt16() { var number = (ushort)1234U; var builder = new NumericIndexBuilder <ushort>(); var level0Index = builder.Build(number, 0); Assert.Equal(new int[] { }, level0Index); var level1Index = builder.Build(number, 1); Assert.Equal(new[] { 1 }, level1Index); var level3Index = builder.Build(number, 3); Assert.Equal(new[] { 1, 2, 3 }, level3Index); var level10Index = builder.Build(number, 10); Assert.Equal(new[] { 1, 2, 3, 4 }, level10Index); }
public void DefaultIndexBuilderNegativeInt16() { var number = (short)-1234; var builder = new NumericIndexBuilder<short>(); var level0Index = builder.Build(number, 0); Assert.Equal(new int[] { }, level0Index); var level1Index = builder.Build(number, 1); Assert.Equal(new[] { NumericIndices.MinusPosition }, level1Index); var level3Index = builder.Build(number, 3); Assert.Equal(new[] { NumericIndices.MinusPosition, 1, 2 }, level3Index); var level10Index = builder.Build(number, 10); Assert.Equal(new[] { NumericIndices.MinusPosition, 1, 2, 3, 4 }, level10Index); }
public void DefaultIndexBuilderUInt16() { var number = (ushort)1234U; var builder = new NumericIndexBuilder<ushort>(); var level0Index = builder.Build(number, 0); Assert.Equal(new int[] { }, level0Index); var level1Index = builder.Build(number, 1); Assert.Equal(new[] { 1 }, level1Index); var level3Index = builder.Build(number, 3); Assert.Equal(new[] { 1, 2, 3 }, level3Index); var level10Index = builder.Build(number, 10); Assert.Equal(new[] { 1, 2, 3, 4 }, level10Index); }
public void DefaultIndexBuilderNegativeLong() { var number = -12345678901L; var builder = new NumericIndexBuilder<long>(); var level0Index = builder.Build(number, 0); Assert.Equal(new int[] {}, level0Index); var level1Index = builder.Build(number, 1); Assert.Equal(new[] {NumericIndices.MinusPosition}, level1Index); var level3Index = builder.Build(number, 3); Assert.Equal(new[] {NumericIndices.MinusPosition, 1, 2}, level3Index); var level10Index = builder.Build(number, 10); Assert.Equal(new[] {NumericIndices.MinusPosition, 1, 2, 3, 4, 5, 6, 7, 8, 9}, level10Index); }