Exemplo n.º 1
0
        public void CompareToIsImplemented()
        {
            MassFlow grampersecond = MassFlow.FromGramsPerSecond(1);

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

            Assert.AreEqual(0, grampersecond.CompareTo(grampersecond));
            Assert.Greater(grampersecond.CompareTo(MassFlow.Zero), 0);
            Assert.Less(MassFlow.Zero.CompareTo(grampersecond), 0);
        }
Exemplo n.º 3
0
        public void CompareToThrowsOnNull()
        {
            MassFlow grampersecond = MassFlow.FromGramsPerSecond(1);

// ReSharper disable once ReturnValueOfPureMethodIsNotUsed
            grampersecond.CompareTo(null);
        }
Exemplo n.º 4
0
        public void CompareToThrowsOnTypeMismatch()
        {
            MassFlow grampersecond = MassFlow.FromGramsPerSecond(1);

// ReSharper disable once ReturnValueOfPureMethodIsNotUsed
            grampersecond.CompareTo(new object());
        }
Exemplo n.º 5
0
        public void CompareToThrowsOnNull()
        {
            MassFlow grampersecond = MassFlow.FromGramsPerSecond(1);

            Assert.Throws <ArgumentNullException>(() => grampersecond.CompareTo(null));
        }
Exemplo n.º 6
0
        public void CompareToThrowsOnTypeMismatch()
        {
            MassFlow grampersecond = MassFlow.FromGramsPerSecond(1);

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