NLite.Data.Test.NorthwindExecutionTest.TestMathFloor C# (CSharp) Method

TestMathFloor() private method

private TestMathFloor ( ) : void
return void
        public virtual void TestMathFloor()
        {
            // The difference between floor and truncate is how negatives are handled.  Floor drops the decimals and moves the
            // value to the more negative, so Floor(-3.4) is -4.0 and Floor(3.4) is 3.0.
            var four = db.Customers.Where(c => c.CustomerID == "ALFKI").Sum(c => Math.Floor((c.CustomerID == "ALFKI" ? 3.4 : 3.4)));
            var six = db.Customers.Where(c => c.CustomerID == "ALFKI").Sum(c => Math.Floor((c.CustomerID == "ALFKI" ? 3.6 : 3.6)));
            var nfour = db.Customers.Where(c => c.CustomerID == "ALFKI").Sum(c => Math.Floor((c.CustomerID == "ALFKI" ? -3.4 : -3.4)));
            AssertValue(Math.Floor(3.4), four);
            AssertValue(Math.Floor(3.6), six);
            AssertValue(Math.Floor(-3.4), nfour);
        }
NorthwindExecutionTest