Example #1
0
        public void Returns5LastColumnValuesGivenGridOfAscendingRows()
        {
            var result = SaddleAnalyzer.GetSaddleValues(GetTestGrid());

            Assert.AreEqual(5, result.Count);
            Assert.AreEqual(5, result.Count(r => r.Value == 4));
        }
Example #2
0
        public void ReturnsEmptyListGivenNoSaddleGrid()
        {
            var result = SaddleAnalyzer.GetSaddleValues(GetNoSaddleGrid());

            Assert.False(result.Any());
        }
Example #3
0
        public void ReturnsOneItemGivenGridOfProducts()
        {
            var result = SaddleAnalyzer.GetSaddleValues(GetProductGrid());

            Assert.AreEqual(1, result.Count(r => r.Value == 5));
        }
Example #4
0
        public void Returns25NumbersGivenGridOfSameValue()
        {
            var result = SaddleAnalyzer.GetSaddleValues(GetSingleNumberGrid());

            Assert.AreEqual(25, result.Count);
        }