Пример #1
0
        public void ToStringReturnsExpectedValue()
        {
            var value = Math.Abs(_fixture.Create <int>());
            var sut   = new WordOffset(value);

            var result = sut.ToString();

            Assert.Equal(value.ToString(), result);
        }
Пример #2
0
        public void LessThanOrEqualOperatorReturnsExpectedValue(int left, int right, bool expected)
        {
            var sut   = new WordOffset(left);
            var other = new WordOffset(right);

            var result = sut <= other;

            Assert.Equal(expected, result);
        }
Пример #3
0
        public void CompareToReturnsExpectedResult(int left, int right, int expected)
        {
            var sut   = new WordOffset(left);
            var other = new WordOffset(right);

            var result = sut.CompareTo(other);

            Assert.Equal(expected, result);
        }
        public static ShapeIndexRecord Read(BinaryReader reader)
        {
            if (reader == null)
            {
                throw new ArgumentNullException(nameof(reader));
            }

            var offset        = new WordOffset(reader.ReadInt32BigEndian());
            var contentLength = new WordLength(reader.ReadInt32BigEndian());

            return(new ShapeIndexRecord(offset, contentLength));
        }
Пример #5
0
 public ShapeIndexRecord IndexAt(WordOffset offset) => new ShapeIndexRecord(offset, Header.ContentLength);
 public ShapeIndexRecord(WordOffset offset, WordLength contentLength)
 {
     Offset        = offset;
     ContentLength = contentLength;
 }
Пример #7
0
 public ShapeIndexRecord IndexAt(WordOffset offset)
 {
     return(new ShapeIndexRecord(offset, Header.ContentLength));
 }