コード例 #1
0
    public void TestStartAnswerWithoutCurrentSpeakerStopsList()
    {
        var instance = new ListOfSpeakersViewModel();

        instance.StartAnswer();
        Assert.AreEqual(ESpeakerListStatus.Stopped, instance.Status);
    }
コード例 #2
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);
    }
コード例 #3
0
    public void TestAnswerSetsTimeToQuestionTime()
    {
        var instance = new ListOfSpeakersViewModel();

        instance.QuestionTime = new TimeSpan(0, 0, 30);
        instance.AddSpeaker("Speaker");
        instance.NextSpeaker();
        instance.StartAnswer();
        Assert.AreEqual(30, instance.RemainingSpeakerTime.TotalSeconds, 1);
        //Assert.IsTrue(instance.RemainingSpeakerTime.TotalSeconds >= 29 && instance.RemainingSpeakerTime.TotalSeconds <= 30);
    }
コード例 #4
0
    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);
    }