Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReportCorrectTypeBasedOnProperBitsOnly()
        public virtual void ShouldReportCorrectTypeBasedOnProperBitsOnly()
        {
            // given
            DynamicRecord property = InUse(Record(42));
            // Type is 9, which is string, but has an extra bit set at a higher up position
            int type = PropertyType.STRING.intValue();

            type = type | 0b10000000;

            property.SetType(type);

            // when
            PropertyType reportedType = property.getType();

            // then
            // The type must be string
            assertEquals(PropertyType.STRING, reportedType);
            // but the type data must be preserved
            assertEquals(type, property.TypeAsInt);
        }