예제 #1
0
        public void CompareUntyped(double value, double valueToCompareWith, int expectedResult)
        {
            var valueSize = new ByteSize(value);
            object otherSize = new ByteSize(valueToCompareWith);
            var result = valueSize.CompareTo(otherSize);

            Assert.Equal(expectedResult, result);
        }
예제 #2
0
        public void CompareUntyped(double value, double valueToCompareWith, int expectedResult)
        {
            var    valueSize = new ByteSize(value);
            object otherSize = new ByteSize(valueToCompareWith);
            var    result    = valueSize.CompareTo(otherSize);

            Assert.Equal(expectedResult, result);
        }
예제 #3
0
        public void CompareTo_ValuesAreEqual()
        {
            var leftValue  = new ByteSize(1000);
            var rightValue = new ByteSize(1000);

            //Act
            var actual = leftValue.CompareTo(rightValue);

            //Assert
            actual.Should().Be(0);
        }
예제 #4
0
        public void CompareTo_ValueIsLarger()
        {
            var leftValue  = new ByteSize(1002);
            var rightValue = new ByteSize(1001);

            //Act
            var actual = leftValue.CompareTo(rightValue);

            //Assert
            actual.Should().BeGreaterThan(0);
        }
예제 #5
0
        public void CompareTo_ValueIsSmaller()
        {
            var leftValue  = new ByteSize(1000);
            var rightValue = new ByteSize(1001);

            //Act
            var actual = leftValue.CompareTo(rightValue);

            //Assert
            actual.Should().BeLessThan(0);
        }
예제 #6
0
 public int CompareTo(FileSize other)
 {
     return(ByteSize.CompareTo(other.ByteSize));
 }