コード例 #1
0
        public void CompareToIsImplemented()
        {
            Luminance candelapersquaremeter = Luminance.FromCandelaPerSquareMeters(1);

            Assert.Equal(0, candelapersquaremeter.CompareTo(candelapersquaremeter));
            Assert.True(candelapersquaremeter.CompareTo(Luminance.Zero) > 0);
            Assert.True(Luminance.Zero.CompareTo(candelapersquaremeter) < 0);
        }
コード例 #2
0
        public void CompareToThrowsOnNull()
        {
            Luminance candelapersquaremeter = Luminance.FromCandelaPerSquareMeters(1);

            Assert.Throws <ArgumentNullException>(() => candelapersquaremeter.CompareTo(null));
        }
コード例 #3
0
        public void CompareToThrowsOnTypeMismatch()
        {
            Luminance candelapersquaremeter = Luminance.FromCandelaPerSquareMeters(1);

            Assert.Throws <ArgumentException>(() => candelapersquaremeter.CompareTo(new object()));
        }