public void GetTimeRequiredToRead() { // arragment _timeSettings.Second = 30; var velocityCalculator = new VelocityReadCalculator(_book, _pomodoroSettings, _timeSettings); // act var timerRequiredResult = velocityCalculator.GetTimeRequiredToRead(); //assert Assert.IsTrue(timerRequiredResult.Hour == 1); Assert.IsTrue(timerRequiredResult.Minute == 15); }
public void GetTimeRequiredToRead_DateTimeFormat() { // arragment _timeSettings.Second = 30; var velocityCalculator = new VelocityReadCalculator(_book, _pomodoroSettings, _timeSettings); // act var timerRequiredResult = velocityCalculator.GetTimeRequiredToRead(); // 2 min and 30 seconds per page, 30 pages should be 75 minutes // the result should be 1:15:00 One hour, fifteen minutes. //assert Assert.IsTrue(timerRequiredResult.GetDateTimeFormat() == DateTime.Parse("1:15:00")); }
public void GetPomodoroRequiredToRead() { // arragment var velocityCalculator = new VelocityReadCalculator(_book, _pomodoroSettings, _timeSettings); var timeRequired = velocityCalculator.GetTimeRequiredToRead(); // act var pomodoroRequiredResult = velocityCalculator.GetPomodoroRequired(timeRequired); // 1 pomodoro --> 30 minutes, since the current pages is 30pg and the velocity per page is 2 min // the result should be 2p hours //assert Assert.IsTrue(pomodoroRequiredResult == 2); }
public void GetTimeRequiredToRead_FractionFormat() { // arragment _timeSettings.Second = 30; var velocityCalculator = new VelocityReadCalculator(_book, _pomodoroSettings, _timeSettings); // act var timerRequiredResult = velocityCalculator.GetTimeRequiredToRead(); // 2 min and 30 seconds per page, 30 pages should be 75 minutes // 60 min --> 1 whole // 75 min --> ? part // the result should be 1.25 hours //assert Assert.IsTrue(timerRequiredResult.GetFractionFormat() == 1.2); }