Esempio n. 1
0
        [TestCase(3, 6, 1)]  // later line, later column
        public void TestCompare(int line, int column, int result)
        {
            var location     = new TextLocation(2, 5);
            var testLocation = new TextLocation(line, column);

            if (result < 0)
            {
                Assert.That(testLocation < location, Is.True);
                Assert.That(testLocation <= location, Is.True);
                Assert.That(testLocation == location, Is.False);
                Assert.That(testLocation > location, Is.False);
                Assert.That(testLocation >= location, Is.False);
                Assert.That(testLocation != location, Is.True);
                Assert.That(testLocation.Equals(location), Is.False);
            }
            else if (result > 0)
            {
                Assert.That(testLocation < location, Is.False);
                Assert.That(testLocation <= location, Is.False);
                Assert.That(testLocation == location, Is.False);
                Assert.That(testLocation > location, Is.True);
                Assert.That(testLocation >= location, Is.True);
                Assert.That(testLocation != location, Is.True);
                Assert.That(testLocation.Equals(location), Is.False);
            }
            else
            {
                Assert.That(testLocation < location, Is.False);
                Assert.That(testLocation <= location, Is.True);
                Assert.That(testLocation == location, Is.True);
                Assert.That(testLocation > location, Is.False);
                Assert.That(testLocation >= location, Is.True);
                Assert.That(testLocation != location, Is.False);
                Assert.That(testLocation.Equals(location), Is.True);
            }
        }