Ejemplo n.º 1
0
        public void SampleTest()
        {
            var reader = new ReaderStub(new[] { "1", "0", "1", "0", "1" });
            var length = 0;

            using (var calculator = new ConsequentOnesCalculator(reader))
            {
                length = calculator.GetOnesLongestSequenceLength(5);
            }
            Assert.AreEqual(1, length);
        }
Ejemplo n.º 2
0
        public void OnlyZeroTest()
        {
            var reader = new ReaderStub(new[] { "0" });
            var length = 0;

            using (var calculator = new ConsequentOnesCalculator(reader))
            {
                length = calculator.GetOnesLongestSequenceLength(1);
            }
            Assert.AreEqual(0, length);
        }