コード例 #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);
        }
コード例 #2
0
        public void ToStringReturnsExpectedValue()
        {
            var value = _fixture.Create <int>().AsByteLengthValue();
            var sut   = new ByteLength(value);

            var result = sut.ToString();

            Assert.Equal(value.ToString(), result);
        }
コード例 #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);
        }
コード例 #4
0
 public ByteOffset Plus(ByteLength other)
 {
     return(new ByteOffset(_value + other.ToInt32()));
 }
コード例 #5
0
ファイル: WordLength.cs プロジェクト: yreynhout/shaperon
 public int CompareTo(ByteLength other)
 {
     return(_value.CompareTo(other.ToWordLength().ToInt32()));
 }
コード例 #6
0
ファイル: WordLength.cs プロジェクト: yreynhout/shaperon
 public WordLength Minus(ByteLength other)
 {
     return(new WordLength(_value - other.ToWordLength().ToInt32()));
 }
コード例 #7
0
 public WordOffset Plus(ByteLength other) => new WordOffset(_value + other.ToWordLength().ToInt32());
コード例 #8
0
 public WordLength Minus(ByteLength other) => new WordLength(_value - other.ToWordLength().ToInt32());
コード例 #9
0
 internal AnonymousShapeContent(ShapeType shapeType, byte[] content)
 {
     ShapeType     = shapeType;
     Content       = content ?? throw new ArgumentNullException(nameof(content));
     ContentLength = new ByteLength(content.Length).ToWordLength();
 }
コード例 #10
0
 public ByteOffset Plus(ByteLength other) => new ByteOffset(_value + other.ToInt32());