コード例 #1
0
        public void CompareToIsImplemented()
        {
            SpaceVelocity literpersecondcubicmeter = SpaceVelocity.FromLiterPerSecondCubicMeters(1);

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

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

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