public void TestResetSpeakerTime() { var instance = new ListOfSpeakersViewModel(); instance.SpeakerTime = new TimeSpan(0, 0, 30); instance.AddSpeaker("Speaker 1"); instance.NextSpeaker(); instance.ResumeSpeaker(); instance.AddSpeakerSeconds(-10); Assert.IsTrue(instance.RemainingSpeakerTime.TotalSeconds <= 20); instance.ResetSpeakerTime(); Assert.AreEqual(30, instance.RemainingSpeakerTime.TotalSeconds, 0.5); }
public void TestResumePausedAnswer() { var instance = new ListOfSpeakersViewModel(); instance.QuestionTime = new TimeSpan(0, 0, 30); instance.AddSpeaker("Speaker"); instance.NextSpeaker(); instance.StartAnswer(); instance.AddSpeakerSeconds(-10); instance.Pause(); Assert.AreEqual(20, instance.RemainingSpeakerTime.TotalSeconds, 0.5); instance.ResumeSpeaker(); Assert.AreEqual(20, instance.RemainingSpeakerTime.TotalSeconds, 0.5); }