Exemplo n.º 1
0
        public void CompareToIsImplemented()
        {
            SpecificWeight newtonpercubicmeter = SpecificWeight.FromNewtonsPerCubicMeter(1);

            Assert.Equal(0, newtonpercubicmeter.CompareTo(newtonpercubicmeter));
            Assert.True(newtonpercubicmeter.CompareTo(SpecificWeight.Zero) > 0);
            Assert.True(SpecificWeight.Zero.CompareTo(newtonpercubicmeter) < 0);
        }
Exemplo n.º 2
0
        public void CompareToIsImplemented()
        {
            SpecificWeight newtonpercubicmeter = SpecificWeight.FromNewtonsPerCubicMeter(1);

            Assert.AreEqual(0, newtonpercubicmeter.CompareTo(newtonpercubicmeter));
            Assert.Greater(newtonpercubicmeter.CompareTo(SpecificWeight.Zero), 0);
            Assert.Less(SpecificWeight.Zero.CompareTo(newtonpercubicmeter), 0);
        }
Exemplo n.º 3
0
        public void CompareToThrowsOnNull()
        {
            SpecificWeight newtonpercubicmeter = SpecificWeight.FromNewtonsPerCubicMeter(1);

// ReSharper disable once ReturnValueOfPureMethodIsNotUsed
            newtonpercubicmeter.CompareTo(null);
        }
Exemplo n.º 4
0
        public void CompareToThrowsOnNull()
        {
            SpecificWeight newtonpercubicmeter = SpecificWeight.FromNewtonsPerCubicMeter(1);

            Assert.Throws <ArgumentNullException>(() => newtonpercubicmeter.CompareTo(null));
        }
Exemplo n.º 5
0
        public void CompareToThrowsOnTypeMismatch()
        {
            SpecificWeight newtonpercubicmeter = SpecificWeight.FromNewtonsPerCubicMeter(1);

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