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); }
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); }
public ByteOffset Plus(ByteLength other) { return(new ByteOffset(_value + other.ToInt32())); }
public int CompareTo(ByteLength other) { return(_value.CompareTo(other.ToWordLength().ToInt32())); }
public WordLength Minus(ByteLength other) { return(new WordLength(_value - other.ToWordLength().ToInt32())); }
public WordOffset Plus(ByteLength other) => new WordOffset(_value + other.ToWordLength().ToInt32());
public WordLength Minus(ByteLength other) => new WordLength(_value - other.ToWordLength().ToInt32());
internal AnonymousShapeContent(ShapeType shapeType, byte[] content) { ShapeType = shapeType; Content = content ?? throw new ArgumentNullException(nameof(content)); ContentLength = new ByteLength(content.Length).ToWordLength(); }
public ByteOffset Plus(ByteLength other) => new ByteOffset(_value + other.ToInt32());