Example #1
0
        public void CompareToIsImplemented()
        {
            IrradiationDose gray = IrradiationDose.FromGray(1);

            Assert.Equal(0, gray.CompareTo(gray));
            Assert.True(gray.CompareTo(IrradiationDose.Zero) > 0);
            Assert.True(IrradiationDose.Zero.CompareTo(gray) < 0);
        }
Example #2
0
        public void CompareToThrowsOnNull()
        {
            IrradiationDose gray = IrradiationDose.FromGray(1);

            Assert.Throws <ArgumentNullException>(() => gray.CompareTo(null));
        }
Example #3
0
        public void CompareToThrowsOnTypeMismatch()
        {
            IrradiationDose gray = IrradiationDose.FromGray(1);

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