当前位置: 首页>>代码示例>>C#>>正文


C# NUnit.Framework.GetLength方法代码示例

本文整理汇总了C#中NUnit.Framework.GetLength方法的典型用法代码示例。如果您正苦于以下问题:C# NUnit.Framework.GetLength方法的具体用法?C# NUnit.Framework.GetLength怎么用?C# NUnit.Framework.GetLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NUnit.Framework的用法示例。


在下文中一共展示了NUnit.Framework.GetLength方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FailsForCollinearPoints

        public void FailsForCollinearPoints()
        {
            var tests = new[,]
            {
                {new Vector(), new Vector(), new Vector()},
                {new Vector(-1000, -1000), new Vector(), new Vector(1000, 1000)},
                {new Vector(123, 0), new Vector(234, 0), new Vector(345, 0)},
                {new Vector(0, 123), new Vector(0, 234), new Vector(0, 345)}
            };

            for (int i = 0; i < tests.GetLength(0); i++)
            {
                Assert.Throws(typeof(CollinearPointsException), () => { Helpers.CircleCenter(tests[i, 0], tests[i, 1], tests[i, 2]); });
            }
        }
开发者ID:EkardNT,项目名称:VoronoiGenerators,代码行数:15,代码来源:CircleCenterTests.cs

示例2: CorrectlyIdentifiesDivergingScenarios

        public void CorrectlyIdentifiesDivergingScenarios()
        {
            // Sweepline at 0 for all these tests.
            var tests = new[,]
            {
                {new Vector(-1, 0), new Vector(1, 0), new Vector(3, 0)},
                {new Vector(1, 0), new Vector(3, 1), new Vector(5, 9)},
                {new Vector(1, 1), new Vector(2, 2), new Vector(3, 3)},
                {new Vector(1, 1), new Vector(3, 2), new Vector(4, 7)}
            };

            for (int i = 0; i < tests.GetLength(0); i++)
                Assert.That(Helpers.TestBreakpointsConvergence(tests[i, 0], tests[i, 1], tests[i, 2]), Is.False, string.Format(
                    "Expected Helpers.TestBreakpointsConvergence() to report that the arcs defined from left to right by the sites {0}, {1}, and {2} diverged, but it reported that they converged.",
                    tests[i, 0],
                    tests[i, 1],
                    tests[i, 2]));
        }
开发者ID:EkardNT,项目名称:VoronoiGenerators,代码行数:18,代码来源:TestBreakpointsConvergenceTests.cs

示例3: ReturnsCorrectCenter

        public void ReturnsCorrectCenter()
        {
            // First three vectors are inputs, last is expected output.
            var tests = new[,]
            {
                {new Vector(0, 0), new Vector(0, 10), new Vector(10, 0), new Vector(5, 5)},
                {new Vector(-1,0), new Vector(0, 1), new Vector(1, 0), new Vector(0, 0)},
                {new Vector(0, 10), new Vector(10, 0), new Vector(10, 30), new Vector(15, 15)}
            };

            for (int i = 0; i < tests.GetLength(0); i++)
            {
                var output = Helpers.CircleCenter(tests[i, 0], tests[i, 1], tests[i, 2]);
                Assert.That(output == tests[i, 3], Is.True, string.Format("For inputs {0}, {1}, {2} expected output {3} but output was {4}.",
                    tests[i, 0],
                    tests[i, 1],
                    tests[i, 2],
                    tests[i, 3],
                    output));
            }
        }
开发者ID:EkardNT,项目名称:VoronoiGenerators,代码行数:21,代码来源:CircleCenterTests.cs


注:本文中的NUnit.Framework.GetLength方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。