Exemple #1
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);
    }
Exemple #2
0
    public void TestStartQuestionWithoutCurrentStopsList()
    {
        var instance = new ListOfSpeakersViewModel();

        instance.ResumeQuestion();
        Assert.AreEqual(ESpeakerListStatus.Stopped, instance.Status);
    }
Exemple #3
0
    public async Task TestStartQuestion()
    {
        _instance.ResumeQuestion();
        Assert.IsTrue(_instance.Status == ESpeakerListStatus.Question);
        await Task.Delay(3000);

        Assert.AreEqual(27, (int)Math.Round(_instance.RemainingQuestionTime.TotalSeconds));
    }
Exemple #4
0
    public void TestClearCurrentQuestionWhileQuestionActive()
    {
        var instance = new ListOfSpeakersViewModel();

        instance.AddQuestion("Question");
        instance.NextQuestion();
        instance.ResumeQuestion();
        instance.ClearCurrentQuestion();
        Assert.AreEqual(ESpeakerListStatus.Stopped, instance.Status);
    }
Exemple #5
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);
    }
Exemple #6
0
    public void TestResetQuestionTIme()
    {
        var instance = new ListOfSpeakersViewModel();

        instance.AddQuestion("Question 1");
        instance.NextQuestion();
        instance.ResumeQuestion();
        instance.AddQuestionSeconds(-10);
        Assert.AreEqual(20, instance.RemainingQuestionTime.TotalSeconds, 0.5);
        instance.ResetQuestionTime();
        Assert.AreEqual(30, instance.RemainingQuestionTime.TotalSeconds, 0.5);
    }
Exemple #7
0
    public void TestStartQuestionFromStopResetsTime()
    {
        var instance = new ListOfSpeakersViewModel();

        instance.QuestionTime = new TimeSpan(0, 0, 30);
        var question = instance.AddQuestion("Question");

        instance.NextQuestion();
        instance.ResumeQuestion();
        // 29 to have a little puffer but this should compute instant
        Assert.IsTrue(instance.RemainingQuestionTime.TotalSeconds >= 29);
    }