예제 #1
0
        public void UpdateCounter_Counterの正常系テスト()
        {
            UpdateCounter counter = new UpdateCounter();

            counter.CountUp();
            counter.CountUp();
            counter.CountUp();

            Assert.AreEqual(counter.UpdateNum, 3);
            Assert.AreEqual(counter.UpdateRight, 3);
            Assert.AreEqual(counter.UpdateLeft, 0);

            counter.CountDown();
            counter.CountDown();
            counter.CountDown();

            Assert.AreEqual(counter.UpdateNum, 0);
            Assert.AreEqual(counter.UpdateRight, 3);
            Assert.AreEqual(counter.UpdateLeft, 0);

            counter.CountDown();
            counter.CountDown();
            counter.CountDown();

            Assert.AreEqual(counter.UpdateNum, -3);
            Assert.AreEqual(counter.UpdateRight, 3);
            Assert.AreEqual(counter.UpdateLeft, 3);

            counter.CountUp();
            counter.CountUp();
            counter.CountUp();

            Assert.AreEqual(counter.UpdateNum, 0);
            Assert.AreEqual(counter.UpdateRight, 3);
            Assert.AreEqual(counter.UpdateLeft, 3);
            //Assert.AreEqual(agent.Belief, agent.PriorBelief);

            //Assert.IsTrue(Math.Abs(agent.Belief - agent.PriorBelief) < 0.00001);
        }