コード例 #1
0
        public void GetCentreLayer_WhenConfigurationIsForAnOddNumber_ReturnsTheIndexOfTheCentreLayer(int size, int expected)
        {
            var configuration = new CubeConfiguration<int>(size);

            var centreLayerIndex = configuration.GetCentreLayer();

            Assert.AreEqual(expected, centreLayerIndex);
        }
コード例 #2
0
        public void GetCentreLayer_WhenConfigurationIsForAnEvenNumber_ThrowsInvalidOperationException(int size)
        {
            var configuration = new CubeConfiguration<int>(size);

            TestDelegate testFunc = () => configuration.GetCentreLayer();

            Assert.Throws<InvalidOperationException>(testFunc);
        }