Exemplo n.º 1
0
        public void WhenProcessingPeriodNumberOfInputs_Then_IsReady_FlipsToTrue()
        {
            const int period = 5;
            var       sut    = new FakeWindowIndicator(period);

            for (int i = 0; i < period - 1; i++)
            {
                sut.Process(0);
                Assert.IsFalse(sut.IsReady);
            }

            sut.Process(0);
            Assert.IsTrue(sut.IsReady);
        }
Exemplo n.º 2
0
        public void WhenProcessingInput_Then_RollingWindowIsPopulated()
        {
            var function = new FakeWindowComputation();
            var sut      = new FakeWindowIndicator(function, 2);

            sut.Process(1);
            Assert.AreEqual(1, function.WindowPassedToCompute[0]);
        }