//метод для обработчика события CreatingSticker public Stick СreatingStickerForHander(AnswerId answerId) { Stick stick = new Stick(answerId.id, User.id); User.sticks.Add(stick); return(stick); }
public Score(ScoreId id, ProctorId proctorId, Grade grade, QuestionId questionId, AnswerId answerId) : base(id) { ProctorId = proctorId; Grade = grade; QuestionId = questionId; AnswerId = answerId; }
private void ProcessCreateStickResult(AnswerId answer) { var stick = new StickViewModel(); stick.FromStick(Client.Listener.СreatingStickerForHander(answer)); StickCollection.Add(stick); }
public AnswerTestBuilder WithId(long id) { var answerId = new AnswerId(id); Id = answerId; return(this); }
public AnswerTestBuilder() { Id = new AnswerId(2); Body = "Some Answer Text"; Responder = 6; Question = 83; }
public void TestAnswerIdQuestionIdAndLineNumberConstructor() { var answerId = new AnswerId(new QuestionId(new QuestionCatalogName("question-catalog"), 10), 12); Assert.That(answerId.Value, Is.EqualTo("question-catalog:10/12")); Assert.AreEqual(new QuestionId(answerId.Value.Split('/')[0]), answerId.QuestionId); Assert.AreEqual(int.Parse(answerId.Value.Split('/')[1]), answerId.LineNumber); }
public ReceiveScoreCommand(Guid examId, Guid proctorId, double gradePercent, QuestionId questionId, AnswerId answerId) : base(ExamId.With(examId)) { ProctorId = ProctorId.With(proctorId); GradePercent = gradePercent; QuestionId = questionId; AnswerId = answerId; }
public void Handle(AddAnswer command) { var id = _answerRepository.GetNextId(AnswerSequenceName); var answerId = new AnswerId(id); var responderId = _claimHelper.GetUserId(); var answer = new Answer(answerId, command.Body, command.Question, responderId); _answerRepository.Create(answer); }
//метод для обработчика события SigningUp, true - если зарегистрировались public bool SignUpForHandler(AnswerId answerId, string login, string password) { if (answerId.id == -1) { return(false); } User = new User(answerId.id, login); return(true); }
public void Handle(ChosenAnswer command) { var answerId = new AnswerId(command.AnswerId); var answer = _answerRepository.Get(answerId); var questionId = new QuestionId(command.QuestionId); var questionAnswers = _answerRepository.GetByQuestionId(questionId); var userId = _claimHelper.GetUserId(); answer.SetAsChosenAnswer(command.QuestionInquirerId, userId, questionAnswers); _answerRepository.Update(answer); }
private void ProcessSingUpResult(AnswerId id) { //TO DO: ////if (Client.Listener.SignUpForHandler(id, *Login* , *Password* )) //{ // MessageBox.Show("SingUp successful"); //} //else //{ // MessageBox.Show("Failed to SingUp"); //} }
public void TestAnswerIdInvalidFormat(string input, bool throws) { if (throws) { var ex = Assert.Throws <ArgumentException>(() => new AnswerId(input)); Assert.AreEqual($"The AnswerId has an invalid format: \"{input}\", Expected \"<question-catalog-name>:<questionLineNumber>/<answerLineNumber>\".", ex.Message); } else { var answerId = new AnswerId(input); Assert.AreEqual(input, answerId.Value); var split = input.Split('/'); Assert.AreEqual(split[0], answerId.QuestionId.Value); } }
public void TestEmptyAnswerIdThrows(string input) { Assert.Throws <ArgumentNullException>(() => AnswerId.From(input)); }
public override int GetHashCode() { return(AnswerId.GetHashCode()); }