コード例 #1
0
        public void HandleClockTickTest()
        {
            var arg = new OnClockTickEventArgs {
                Maker = this.Maker
            };
            Action act = () => OvenManager.HandleClockTick(null, arg);

            act.Should().NotThrow();

            this.Maker.FirstOven.State.Should().Be(OvenState.Off);
            this.Maker.FirstOven.CurrentTemperature.Should().Be(22);
        }
コード例 #2
0
        public void HandleHeatingBorderTickTest()
        {
            OvenManager.SetState(this.Maker, 232, OvenState.Heating);
            Switcher.SetSwitch(this.Maker, SwitchState.On);

            var arg = new OnClockTickEventArgs {
                Maker = this.Maker
            };
            Action act = () => OvenManager.HandleClockTick(null, arg);

            act.Should().NotThrow();

            this.Maker.FirstOven.State.Should().Be(OvenState.Cooling);
            this.Maker.FirstOven.CurrentTemperature.Should().Be(240);
        }
コード例 #3
0
        public void HandleOffBiscuitHeatingTickTest()
        {
            this.Maker.FirstConveyor.Belt.Add(Biscuit.Create(true, true, false));
            OvenManager.SetState(this.Maker, 235, OvenState.Heating);
            Switcher.SetSwitch(this.Maker, SwitchState.Off);

            var arg = new OnClockTickEventArgs {
                Maker = this.Maker
            };
            Action act = () => OvenManager.HandleClockTick(null, arg);

            act.Should().NotThrow();

            this.Maker.FirstOven.State.Should().Be(OvenState.Cooling);
            this.Maker.FirstOven.CurrentTemperature.Should().Be(240);
        }