Beispiel #1
0
        private void SaveData(FormsContext context)
        {
            var form = new Form { Id = Guid.NewGuid(), Title = "Performance Review" };
            var topic = new Topic { Title = "Competencias Core" };
            form.Topics.Add(topic);
            topic.Questions.Add(this.GetQuestion("Comunicación con sus pares"));
            topic.Questions.Add(this.GetQuestion("Comunicación con el cliente"));
            topic.Questions.Add(this.GetQuestion("Administración de sus tareas"));
            topic.Questions.Add(this.GetQuestion("Cumplimiento de tareas"));

            topic = new Topic { Title = "Competencias Técnicas" };
            form.Topics.Add(topic);
            topic.Questions.Add(this.GetQuestion("Conocimiento Técnico"));
            topic.Questions.Add(this.GetQuestion("Resolución de Problemas Complejos"));
            topic.Questions.Add(this.GetNetChoiceQuestion("Versiones de .NET Trabajadas"));
            topic.Questions.Add(this.GetPlatformChoiceQuestion("Plataformas Trabajadas"));

            topic = new Topic { Title = "Feedback" };
            form.Topics.Add(topic);
            topic.Questions.Add(this.GetFreeTextQuestion("Relación con el manager"));
            topic.Questions.Add(this.GetFreeTextQuestion("Relación con sus pares"));
            topic.Questions.Add(this.GetFreeTextQuestion("Qué opinas de la empresa?"));

            context.Forms.Add(form);
            context.SaveChanges();
        }
Beispiel #2
0
        public void FormDefaultConstructorShouldWork()
        {
            // Arrange
            var expectedId = Guid.Empty;
            var expectedTopics = 0;
            var expectedTitle = string.Empty;

            // Act
            var form = new Form();
            var actualId = form.Id;
            var actualTitle = form.Title;

            // Assert
            Assert.IsNotNull(form);
            Assert.IsNotNull(form.Topics);
            Assert.IsInstanceOfType(form.Topics, typeof(List<Topic>));
            Assert.AreEqual(expectedTopics, form.Topics.Count());
            Assert.AreEqual(expectedId, actualId);
            Assert.AreEqual(expectedTitle, actualTitle);
        }
Beispiel #3
0
 private UserForm ConstructViewModel(Form formData)
 {
     var userForm = Mapper.Map<UserForm>(formData);
     return userForm;
 }