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(); }
public void TopicDefaultConstructorShouldWork() { // Arrange var expectedTitle = string.Empty; var expectedId = 0; var expectedQuestionsCount = 0; // Act var actual = new Topic(); // Assert Assert.IsNotNull(actual); Assert.IsNotNull(actual.Questions); Assert.IsInstanceOfType(actual.Questions, typeof(List<Question>)); Assert.AreEqual(expectedQuestionsCount, actual.Questions.Count()); Assert.AreEqual(expectedTitle, actual.Title); Assert.AreEqual(expectedId, actual.Id); }