コード例 #1
0
        public void CompareToIsImplemented()
        {
            ReciprocalArea inversesquaremeter = ReciprocalArea.FromInverseSquareMeters(1);

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

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

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