public void NoAnswerSetAsCorrectIsNotValid()
        {
            // Arrange
            var possibleAnswers = new PossibleAnswers();
            possibleAnswers.Add(CompetitionAnswer.A, "Darth Vader");
            possibleAnswers.Add(CompetitionAnswer.B, "Obi Wan Kenobi");
            possibleAnswers.Add(CompetitionAnswer.C, "George Lucas");
            possibleAnswers.Add(CompetitionAnswer.D, "Walt Disney");

            // Act
            bool isValid = possibleAnswers.IsValid;

            // Assert
            Assert.IsFalse(isValid);
        }
        public void PossibleAnswersIsValid()
        {
            // Arrange
            var possibleAnswers = new PossibleAnswers();
            possibleAnswers.Add(CompetitionAnswer.A, "Darth Vader", isCorrectAnswer: true);
            possibleAnswers.Add(CompetitionAnswer.B, "Obi Wan Kenobi");
            possibleAnswers.Add(CompetitionAnswer.C, "George Lucas");
            possibleAnswers.Add(CompetitionAnswer.D, "Walt Disney");

            // Act
            bool isValid = possibleAnswers.IsValid;

            // Assert
            Assert.IsTrue(isValid);
        }
Example #3
0
        private void InitialiseParameters()
        {
            CLOSING_DATE = new DateTime(2013, 1, 1);
            COMPETITION_KEY = StringExtensions.GetRandomString(5);
            CREATED_DATE = DateTime.Now;
            CREATED_BY_ID = GetNewUserID();
            QUESTION = "Who is Luke Skywalkers father?";
            OPEN_STATE = CompetitionStatus.Open;
            CLOSED_STATE = CompetitionStatus.Closed;

            POSSIBLE_ANSWERS = new PossibleAnswers();
            POSSIBLE_ANSWERS.Add(CompetitionAnswer.A, "Darth Vader", isCorrectAnswer: true);
            POSSIBLE_ANSWERS.Add(CompetitionAnswer.B, "Obi Wan Kenobi");
            POSSIBLE_ANSWERS.Add(CompetitionAnswer.C, "George Lucas");
            POSSIBLE_ANSWERS.Add(CompetitionAnswer.D, "Walt Disney");
        }