Exemplo n.º 1
0
        public void RemoveTest()
        {
            RollingWindow<int> rollingWindow = new RollingWindow<int>(5);

            for (int i = 0; i < rollingWindow.WindowSize; i++)
                rollingWindow.Add(i);

            rollingWindow.Remove(1);
            rollingWindow.Remove(3);

            Assert.AreEqual(3, rollingWindow.Count);
            Assert.AreEqual(0, rollingWindow[0]);
            Assert.AreEqual(2, rollingWindow[1]);
            Assert.AreEqual(4, rollingWindow[2]);
        }
Exemplo n.º 2
0
        public void RemoveTest()
        {
            RollingWindow <int> rollingWindow = new RollingWindow <int>(5);

            for (int i = 0; i < rollingWindow.WindowSize; i++)
            {
                rollingWindow.Add(i);
            }

            rollingWindow.Remove(1);
            rollingWindow.Remove(3);

            Assert.AreEqual(3, rollingWindow.Count);
            Assert.AreEqual(0, rollingWindow[0]);
            Assert.AreEqual(2, rollingWindow[1]);
            Assert.AreEqual(4, rollingWindow[2]);
        }