public void CreatePersonWithEmptyNameTest() { //Prepare var agendaService = new AgendaService(); var person = new Person { Id = Guid.NewGuid(), Name = "", Birthday = new DateTime(2010, 02, 5, 10, 20, 00) }; //Assert Action Assert.ThrowsException <EmptyNameException>(() => agendaService.AddPerson(person)); }
public void CreatePersonWithInvalidBirthdayTest() { //Prepare var agendaService = new AgendaService(); var person = new Person { Id = Guid.NewGuid(), Name = "Jo�o", Birthday = new DateTime(1700, 02, 15, 10, 20, 00) }; //Assert Action Assert.ThrowsException <BirthdayTooOldException>(() => agendaService.AddPerson(person)); }
public void CreateAcceptablePersonTest() { //Prepare var agendaService = new AgendaService(); var person = new Person { Id = Guid.NewGuid(), Name = "Jo�o da Silva", Birthday = new DateTime(2010, 02, 5, 10, 20, 00) }; //Action/Call Test Function bool result = agendaService.AddPerson(person); //Assert Assert.IsTrue(result); //Se result for verdadeiro => passa no teste }