public void AddTopic_WhenCalled_AddTopicToTopics() { var topic = new Topic(); _question.AddTopic(topic); Assert.That(_question.Topics, Does.Contain(topic)); }
public void GetForm_IdIsNotNull_ReturnQuestionTopicIdsInViewModel() { _question1.AddTopic(_topic1); _question1.AddTopic(_topic2); var result = _controller.GetForm(_question1.Id); Assert.That(result.Model, Is.TypeOf <QuestionFormViewModel>()); Assert.That((result.Model as QuestionFormViewModel).TopicIds, Is.EquivalentTo(new[] { _topic1.Id, _topic2.Id })); }