コード例 #1
0
        public void Closed_Valid(string familyName)
        {
            var range = ColumnRange.Closed(familyName, "a", "z");

            Assert.Equal(familyName, range.FamilyName);
            Assert.Equal("a", range.StartQualifierClosed.ToStringUtf8());
            Assert.True(range.StartQualifierOpen.IsEmpty);
            Assert.Equal("z", range.EndQualifierClosed.ToStringUtf8());
            Assert.True(range.EndQualifierOpen.IsEmpty);

            range = ColumnRange.Closed(familyName, null, new BigtableByteString(0x12, 0xFE));
            Assert.Equal(familyName, range.FamilyName);
            Assert.True(range.StartQualifierClosed.IsEmpty);
            Assert.True(range.StartQualifierOpen.IsEmpty);
            Assert.Equal(new byte[] { 0x12, 0xFE }, range.EndQualifierClosed.ToByteArray());
            Assert.True(range.EndQualifierOpen.IsEmpty);

            range = ColumnRange.Closed(familyName, ByteString.CopyFrom(0x00, 0x01, 0xFF), null);
            Assert.Equal(familyName, range.FamilyName);
            Assert.Equal(new byte[] { 0x00, 0x01, 0xFF }, range.StartQualifierClosed.ToByteArray());
            Assert.True(range.StartQualifierOpen.IsEmpty);
            Assert.True(range.EndQualifierClosed.IsEmpty);
            Assert.True(range.EndQualifierOpen.IsEmpty);

            range = ColumnRange.Closed(familyName, null, null);
            Assert.Equal(familyName, range.FamilyName);
            Assert.True(range.StartQualifierClosed.IsEmpty);
            Assert.True(range.StartQualifierOpen.IsEmpty);
            Assert.True(range.EndQualifierClosed.IsEmpty);
            Assert.True(range.EndQualifierOpen.IsEmpty);
        }
コード例 #2
0
 public void Closed_Invalid_FamilyName(string familyName)
 {
     Assert.Throws <ArgumentException>(() => ColumnRange.Closed(familyName, "a", "z"));
 }