Ejemplo n.º 1
0
        public void LessThanOrEqualToByteLengthOperatorReturnsExpectedValue(int left, int right, bool expected)
        {
            var sut   = new WordLength(left);
            var other = new ByteLength(right);

            var result = sut <= other;

            Assert.Equal(expected, result);
        }
        public void ToStringReturnsExpectedValue()
        {
            var value = _fixture.Create <int>().AsByteLengthValue();
            var sut   = new ByteLength(value);

            var result = sut.ToString();

            Assert.Equal(value.ToString(), result);
        }
Ejemplo n.º 3
0
        public void CompareToByteLengthReturnsExpectedResult(int left, int right, int expected)
        {
            var sut   = new WordLength(left);
            var other = new ByteLength(right);

            var result = sut.CompareTo(other);

            Assert.Equal(expected, result);
        }
Ejemplo n.º 4
0
 public ByteOffset Plus(ByteLength other)
 {
     return(new ByteOffset(_value + other.ToInt32()));
 }
Ejemplo n.º 5
0
 public int CompareTo(ByteLength other)
 {
     return(_value.CompareTo(other.ToWordLength().ToInt32()));
 }
Ejemplo n.º 6
0
 public WordLength Minus(ByteLength other)
 {
     return(new WordLength(_value - other.ToWordLength().ToInt32()));
 }
Ejemplo n.º 7
0
 public WordOffset Plus(ByteLength other) => new WordOffset(_value + other.ToWordLength().ToInt32());
Ejemplo n.º 8
0
 public WordLength Minus(ByteLength other) => new WordLength(_value - other.ToWordLength().ToInt32());
Ejemplo n.º 9
0
 internal AnonymousShapeContent(ShapeType shapeType, byte[] content)
 {
     ShapeType     = shapeType;
     Content       = content ?? throw new ArgumentNullException(nameof(content));
     ContentLength = new ByteLength(content.Length).ToWordLength();
 }
Ejemplo n.º 10
0
 public ByteOffset Plus(ByteLength other) => new ByteOffset(_value + other.ToInt32());