Пример #1
0
        public void CompareToIsImplemented()
        {
            AbsorbedDose gray = AbsorbedDose.FromGrays(1);

            Assert.Equal(0, gray.CompareTo(gray));
            Assert.True(gray.CompareTo(AbsorbedDose.Zero) > 0);
            Assert.True(AbsorbedDose.Zero.CompareTo(gray) < 0);
        }
Пример #2
0
        public void CompareToThrowsOnNull()
        {
            AbsorbedDose gray = AbsorbedDose.FromGrays(1);

            Assert.Throws <ArgumentNullException>(() => gray.CompareTo(null));
        }
Пример #3
0
        public void CompareToThrowsOnTypeMismatch()
        {
            AbsorbedDose gray = AbsorbedDose.FromGrays(1);

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