Пример #1
0
    public async Task TestPauseQuestion()
    {
        _instance.Pause();
        var remainingSeconds = (int)Math.Round(_instance.RemainingQuestionTime.TotalSeconds);
        await Task.Delay(3000);

        Assert.AreEqual(remainingSeconds, (int)Math.Round(_instance.RemainingQuestionTime.TotalSeconds));
    }
Пример #2
0
    public void TestPauseWHileQUestionPausesQuestion()
    {
        var instance = new ListOfSpeakersViewModel();

        instance.AddQuestion("Question");
        instance.NextQuestion();
        instance.ResumeQuestion();
        Assert.AreEqual(ESpeakerListStatus.Question, instance.Status);
        instance.Pause();
        Assert.AreEqual(ESpeakerListStatus.QuestionPaused, instance.Status);
    }
Пример #3
0
    public void TestPauseWhileAnswerPausesAnswer()
    {
        var instance = new ListOfSpeakersViewModel();

        instance.AddSpeaker("Speaker");
        instance.NextSpeaker();
        instance.StartAnswer();
        Assert.AreEqual(ESpeakerListStatus.Answer, instance.Status);
        instance.Pause();
        Assert.AreEqual(ESpeakerListStatus.AnswerPaused, instance.Status);
    }
Пример #4
0
    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);
    }
Пример #5
0
    public void TestResumePausedQuestion()
    {
        var instance = new ListOfSpeakersViewModel();

        instance.QuestionTime = new TimeSpan(0, 0, 30);
        instance.AddQuestion("Speaker");
        instance.NextQuestion();
        instance.ResumeQuestion();
        instance.AddQuestionSeconds(-10);
        instance.Pause();
        Assert.AreEqual(20, instance.RemainingQuestionTime.TotalSeconds, 0.5);
        instance.ResumeQuestion();
        Assert.AreEqual(20, instance.RemainingQuestionTime.TotalSeconds, 0.5);
    }