public void TestResumePausedSpeaker() { var instance = new ListOfSpeakersViewModel(); instance.SpeakerTime = new TimeSpan(0, 0, 30); instance.AddSpeaker("Speaker"); instance.NextSpeaker(); instance.ResumeSpeaker(); instance.AddSpeakerSeconds(-10); instance.Pause(); Assert.AreEqual(20, instance.RemainingSpeakerTime.TotalSeconds, 0.5); instance.ResumeSpeaker(); Assert.AreEqual(20, instance.RemainingSpeakerTime.TotalSeconds, 0.5); }
public void TestResumeSpeakerAsStartResetsTime() { var instance = new ListOfSpeakersViewModel(); instance.SpeakerTime = new TimeSpan(0, 0, 30); instance.AddSpeaker("Speaker One"); instance.NextSpeaker(); instance.ResumeSpeaker(); instance.StartSpeakerTime = DateTime.Now.ToUniversalTime().AddSeconds(-10); // Faking that the last speaker already removed 10 secs Assert.AreEqual(20, Math.Round(instance.RemainingSpeakerTime.TotalSeconds)); instance.AddSpeaker("Next Speaker"); instance.NextSpeaker(); instance.ResumeSpeaker(); Assert.AreEqual(30, Math.Round(instance.RemainingSpeakerTime.TotalSeconds)); }
public void TestStartSpeakerWithoutCurrentStopsList() { var instance = new ListOfSpeakersViewModel(); instance.ResumeSpeaker(); Assert.AreEqual(ESpeakerListStatus.Stopped, instance.Status); }
public async Task TestStartFirstSpeaker() { _instance.ResumeSpeaker(); Assert.IsTrue(_instance.Status == ESpeakerListStatus.Speaking); await Task.Delay(3000); Assert.AreEqual(177, (int)Math.Round(_instance.RemainingSpeakerTime.TotalSeconds)); }
public void TestClearCurrentSpeakerWhileSpeaking() { var instance = new ListOfSpeakersViewModel(); instance.SpeakerTime = new TimeSpan(0, 0, 30); instance.AddSpeaker("Speaker"); instance.NextSpeaker(); instance.ResumeSpeaker(); instance.ClearCurrentSpeaker(); Assert.AreEqual(ESpeakerListStatus.Stopped, instance.Status); }
public void TestPauseWhileSpeakingPausesSpeaker() { var instance = new ListOfSpeakersViewModel(); instance.AddSpeaker("Speaker"); instance.NextSpeaker(); instance.ResumeSpeaker(); Assert.AreEqual(ESpeakerListStatus.Speaking, instance.Status); instance.Pause(); Assert.AreEqual(ESpeakerListStatus.SpeakerPaused, instance.Status); }
public void TestNextSpeakerWhileActiveSpeakerPauses() { var instance = new ListOfSpeakersViewModel(); instance.AddSpeaker("Speaker"); instance.NextSpeaker(); instance.ResumeSpeaker(); instance.AddQuestion("New Question"); instance.NextQuestion(); Assert.AreEqual(ESpeakerListStatus.SpeakerPaused, instance.Status); }
public void TestNextSpeakerSettingTime() { var instance = new ListOfSpeakersViewModel(); instance.SpeakerTime = new TimeSpan(0, 0, 0, 30); var speaker = instance.AddSpeaker("Speaker 1"); instance.NextSpeaker(); instance.ResumeSpeaker(); Assert.AreEqual(30, instance.RemainingSpeakerTime.TotalSeconds, 1); //Assert.IsTrue(instance.RemainingSpeakerTime.TotalSeconds >= 29 && instance.RemainingSpeakerTime.TotalSeconds < 31); }