Ejemplo n.º 1
0
        public void AddTopic_WhenCalled_AddTopicToTopics()
        {
            var topic = new Topic();

            _question.AddTopic(topic);

            Assert.That(_question.Topics, Does.Contain(topic));
        }
Ejemplo n.º 2
0
        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 }));
        }