Ejemplo n.º 1
0
        public void ShouldConfigurePomodoroTimer()
        {
            var pomodoroMock        = Substitute.For <IConfigurablePomodoro>();
            int taskTimeResult      = -1;
            int breakTimeResult     = -1;
            int repeatTimeResult    = -1;
            int longBreakTimeResult = -1;

            pomodoroMock.Configure(Arg.Do <IPomodoroConfig>(x => {
                taskTimeResult      = x.TaskTime;
                breakTimeResult     = x.BreakTime;
                repeatTimeResult    = x.RepeatTime;
                longBreakTimeResult = x.LongBreakTime;
            }));

            manager.ChangePomodoroConfig(30, 10, 2, 20);

            IConfig config = manager.GetConfig();

            config.ConfigurePomodoro(pomodoroMock);

            pomodoroMock.Received().Configure(Arg.Any <IPomodoroConfig>());
            Assert.AreEqual(taskTimeResult, 30);
            Assert.AreEqual(breakTimeResult, 10);
            Assert.AreEqual(repeatTimeResult, 2);
            Assert.AreEqual(longBreakTimeResult, 20);
        }
Ejemplo n.º 2
0
 public void Configure(IConfig config)
 {
     config.ConfigurePomodoro(this);
 }
Ejemplo n.º 3
0
 public void Configure(IConfig config)
 {
     config.ConfigurePomodoro(this);
 }