コード例 #1
0
        public void CompareToIsImplemented()
        {
            MassFlux kilogrampersecondpersquaremeter = MassFlux.FromKilogramsPerSecondPerSquareMeter(1);

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

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

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