Example #1
0
        public void DecreaseWeight()
        {
            ConveyorBeltInterface view = new ConveyorBeltInterface();

            new DataSimulator(view);
            view.SetResetTimers();
            view.ReadData(1, "Okay", "1");
            view.ReadData(2, "Okay", "2");
            view.ReadData(1, "Okay", "3");
            Assert.IsTrue(view.elapsedWeight == 2);
        }
Example #2
0
        public void SameWeight()
        {
            ConveyorBeltInterface view = new ConveyorBeltInterface();

            new DataSimulator(view);
            view.SetResetTimers();
            view.ReadData(1, "Okay", "1");
            view.ReadData(2, "Okay", "2");
            view.ReadData(2, "Okay", "3");
            Assert.IsTrue(view.sameWeightCount == 1);
        }
Example #3
0
        public void HappyPath()
        {
            ConveyorBeltInterface view = new ConveyorBeltInterface();

            new DataSimulator(view);
            view.SetResetTimers();
            view.ReadData(1, "Okay", "1");
            Assert.IsTrue(view.elapsedWeight == 1);
        }
Example #4
0
        public void ResetAndElapsedWeight()
        {
            ConveyorBeltInterface view = new ConveyorBeltInterface();

            new DataSimulator(view);
            object    sender = null;
            EventArgs e      = null;

            view.SetResetTimers();
            view.ReadData(1, "Okay", "1");
            view.ReadData(2, "Okay", "2");
            view.ReadData(3, "Okay", "3");
            view.Reset(sender, e);
            Assert.IsTrue(view.resetWeight == 3);
            view.ReadData(1, "Okay", "1");
            Assert.IsTrue(view.elapsedWeight == 3);
            view.ReadData(4, "Okay", "4");
            Assert.IsTrue(view.elapsedWeight == 1);
            view.Reset(sender, e);
            Assert.IsTrue(view.resetWeight == 4);
        }