Ejemplo n.º 1
0
    public void TestWithDifferentIds()
    {
        var listOne = new ListOfSpeakersViewModel();
        var listTwo = new ListOfSpeakersViewModel();

        Assert.AreNotEqual(listOne.ListOfSpeakersId, listTwo.ListOfSpeakersId);
        var result = listOne.CompareTo(listTwo);

        Assert.AreEqual(1, result);
    }
Ejemplo n.º 2
0
    public void TestInitWithSameId()
    {
        var listOne = new ListOfSpeakersViewModel();
        var listTwo = new ListOfSpeakersViewModel();

        listTwo.ListOfSpeakersId = listOne.ListOfSpeakersId;
        var result = listOne.CompareTo(listTwo);

        Assert.AreEqual(0, result);
    }
Ejemplo n.º 3
0
    public void TestMoreSpeakersReturnsFalse()
    {
        var instanceOne = new ListOfSpeakersViewModel();
        var instanceTwo = new ListOfSpeakersViewModel();

        instanceTwo.ListOfSpeakersId = instanceOne.ListOfSpeakersId;
        instanceOne.AddSpeaker("Speaker 1");
        var result = instanceOne.CompareTo(instanceTwo);

        Assert.AreNotEqual(0, result);
    }
Ejemplo n.º 4
0
    public void TestListOneHasCurrentSpeakerListTwoDoesnt()
    {
        var listOne = new ListOfSpeakersViewModel()
        {
            ListOfSpeakersId = "fixedId"
        };
        var listTwo = new ListOfSpeakersViewModel()
        {
            ListOfSpeakersId = "fixedId"
        };

        listOne.AddSpeaker("Test");
        listOne.NextSpeaker();
        var result = listOne.CompareTo(listTwo);

        Assert.AreEqual(1, result);
    }
Ejemplo n.º 5
0
    public void StatusDiffers()
    {
        var listOne = new ListOfSpeakersViewModel()
        {
            ListOfSpeakersId = "fixedId",
            Status           = ESpeakerListStatus.Answer
        };
        var listTwo = new ListOfSpeakersViewModel()
        {
            ListOfSpeakersId = "fixedId",
            Status           = ESpeakerListStatus.Stopped
        };

        var result = listOne.CompareTo(listTwo);

        Assert.AreEqual(1, result);
    }
Ejemplo n.º 6
0
    public void StartSpeakerTimeDiffers()
    {
        var listOne = new ListOfSpeakersViewModel()
        {
            ListOfSpeakersId = "fixedId",
            StartSpeakerTime = new DateTime(2021, 1, 1, 12, 0, 0)
        };
        var listTwo = new ListOfSpeakersViewModel()
        {
            ListOfSpeakersId = "fixedId",
            StartSpeakerTime = new DateTime(2021, 1, 1, 12, 0, 1)
        };

        var result = listOne.CompareTo(listTwo);

        Assert.AreEqual(1, result);
    }
Ejemplo n.º 7
0
    public void SpeakerTimeDiffers()
    {
        var listOne = new ListOfSpeakersViewModel()
        {
            ListOfSpeakersId = "fixedId",
            SpeakerTime      = new TimeSpan(0, 0, 30)
        };
        var listTwo = new ListOfSpeakersViewModel()
        {
            ListOfSpeakersId = "fixedId",
            SpeakerTime      = new TimeSpan(0, 0, 29)
        };

        var result = listOne.CompareTo(listTwo);

        Assert.AreEqual(1, result);
    }
Ejemplo n.º 8
0
    public void QuestionsClosedDiffers()
    {
        var listOne = new ListOfSpeakersViewModel()
        {
            ListOfSpeakersId = "fixedId",
            QuestionsClosed  = true
        };
        var listTwo = new ListOfSpeakersViewModel()
        {
            ListOfSpeakersId = "fixedId",
            QuestionsClosed  = false
        };

        var result = listOne.CompareTo(listTwo);

        Assert.AreEqual(1, result);
    }
Ejemplo n.º 9
0
    public void TestPublicIdDiffers()
    {
        var listOne = new ListOfSpeakersViewModel()
        {
            ListOfSpeakersId = "fixedId",
            PublicId         = "ListOne"
        };
        var listTwo = new ListOfSpeakersViewModel()
        {
            ListOfSpeakersId = "fixedId",
            PublicId         = "ListTwo"
        };

        var result = listOne.CompareTo(listTwo);

        Assert.AreEqual(1, result);
    }
Ejemplo n.º 10
0
    public void SpeakersDiffer()
    {
        var listOne = new ListOfSpeakersViewModel()
        {
            ListOfSpeakersId = "fixedId",
        };
        var listTwo = new ListOfSpeakersViewModel()
        {
            ListOfSpeakersId = "fixedId",
        };

        listOne.AddSpeaker("Speaker");
        listTwo.AddSpeaker("Speaker2");

        var result = listOne.CompareTo(listTwo);

        Assert.AreEqual(1, result);
    }
Ejemplo n.º 11
0
    public void TestBothHaveCurrentQuestionButNotTheSame()
    {
        var listOne = new ListOfSpeakersViewModel()
        {
            ListOfSpeakersId = "fixedId"
        };
        var listTwo = new ListOfSpeakersViewModel()
        {
            ListOfSpeakersId = "fixedId"
        };

        listOne.AddQuestion("Test");
        listOne.NextQuestion();
        listTwo.AddQuestion("Test 2");
        listTwo.NextQuestion();
        var result = listOne.CompareTo(listTwo);

        Assert.AreEqual(1, result);
    }
Ejemplo n.º 12
0
    public void TestTwoHasCurrentQuestionOneDoesnt()
    {
        var listOne = new ListOfSpeakersViewModel()
        {
            ListOfSpeakersId = "fixedId"
        };
        var listTwo = new ListOfSpeakersViewModel()
        {
            ListOfSpeakersId = "fixedId"
        };

        listTwo.AddQuestion("Test");
        listTwo.NextQuestion();
        var result = listOne.CompareTo(listTwo);

        Assert.NotNull(listTwo.CurrentQuestion);
        Assert.IsNull(listOne.CurrentQuestion);
        Assert.AreEqual(1, result);
    }