本文整理汇总了C#中Question.AddQuestionResponse方法的典型用法代码示例。如果您正苦于以下问题:C# Question.AddQuestionResponse方法的具体用法?C# Question.AddQuestionResponse怎么用?C# Question.AddQuestionResponse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Question
的用法示例。
在下文中一共展示了Question.AddQuestionResponse方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Given_response_not_on_question_then_response_added
public void Given_response_not_on_question_then_response_added()
{
var questionResponse = new QuestionResponse() {Id = Guid.NewGuid(), Title = "Acceptable"};
var question = new Question();
question.AddQuestionResponse(questionResponse);
Assert.That(question.PossibleResponses.Count,Is.EqualTo(1));
}
示例2: Given_we_are_updating_and_action_required_not_changed_then_lastmodifiedOn_is_not_changed
public void Given_we_are_updating_and_action_required_not_changed_then_lastmodifiedOn_is_not_changed()
{
//Given
var questionResponseId = Guid.NewGuid();
var question = new Question();
question.PossibleResponses.Add(new QuestionResponse() { Id = questionResponseId, Title = "Acceptable", ActionRequired = "Original", LastModifiedOn = DateTime.Now.AddDays(-10)});
//When
question.AddQuestionResponse(new QuestionResponse() { Id = questionResponseId, Title = "Acceptable", ActionRequired = "Original" });
//Then
Assert.That(question.PossibleResponses.Count, Is.EqualTo(1));
Assert.That(question.PossibleResponses[0].ActionRequired, Is.EqualTo("Original"));
Assert.That(question.PossibleResponses[0].LastModifiedOn.Value.Date, Is.EqualTo(DateTime.Now.AddDays(-10).Date));
}
示例3: Given_we_are_updating_the_supporting_evidence_then_supporting_evidence_updated
public void Given_we_are_updating_the_supporting_evidence_then_supporting_evidence_updated()
{
//Given
var questionResponseId = Guid.NewGuid();
var expectedSupportingEvidence = "the new supporting evidence";
var question = new Question();
question.PossibleResponses.Add(new QuestionResponse() { Id = questionResponseId, Title = "Acceptable", SupportingEvidence = "Original" });
//When
question.AddQuestionResponse(new QuestionResponse() { Id = questionResponseId, Title = "Acceptable", SupportingEvidence = expectedSupportingEvidence });
//Then
Assert.That(question.PossibleResponses.Count, Is.EqualTo(1));
Assert.That(question.PossibleResponses[0].SupportingEvidence, Is.EqualTo(expectedSupportingEvidence));
Assert.That(question.PossibleResponses[0].LastModifiedOn, Is.Not.Null, "Last modified date should be set after update");
Assert.That(question.PossibleResponses[0].LastModifiedOn.Value.Date, Is.EqualTo(DateTime.Now.Date));
}
示例4: Given_we_are_updating_the_action_required_then_action_required_updated
public void Given_we_are_updating_the_action_required_then_action_required_updated()
{
//Given
var questionResponseId = Guid.NewGuid();
var expectedActionRequired = "the new action";
var question = new Question();
question.PossibleResponses.Add(new QuestionResponse() { Id = questionResponseId, Title = "Acceptable", ActionRequired = "Original" });
//When
question.AddQuestionResponse(new QuestionResponse() { Id = questionResponseId, Title = "Acceptable", ActionRequired = expectedActionRequired });
//Then
Assert.That(question.PossibleResponses.Count, Is.EqualTo(1));
Assert.That(question.PossibleResponses[0].ActionRequired,Is.EqualTo(expectedActionRequired));
Assert.That(question.PossibleResponses[0].LastModifiedOn, Is.Not.Null,"Last modified date should be set after update");
Assert.That(question.PossibleResponses[0].LastModifiedOn.Value.Date, Is.EqualTo(DateTime.Now.Date));
}
示例5: Given_we_are_removing_the_response_then_response_mark_as_deleted
public void Given_we_are_removing_the_response_then_response_mark_as_deleted()
{
//Given
var questionResponseId = Guid.NewGuid();
var question = new Question();
question.PossibleResponses.Add(new QuestionResponse() { Id = questionResponseId, Title = "Acceptable", Deleted = false});
//When
question.AddQuestionResponse(new QuestionResponse() { Id = questionResponseId, Title = "Acceptable", Deleted = true});
//Then
Assert.That(question.PossibleResponses.Count, Is.EqualTo(1));
Assert.IsTrue(question.PossibleResponses[0].Deleted);
}