public void APersonMustHaveAName() { //Arrange PersonBL.PersonBL logic = new PersonBL.PersonBL(); Person person = new Person() { Id = 1, Name = "", Birthday = DateTime.Now }; //Act & Assert Assert.ThrowsException <ArgumentException>(() => logic.Create(person)); }
public void APersonIsCreated() { //Arrange PersonBL.PersonBL logic = new PersonBL.PersonBL(); Person person = new Person() { Id = 1, Name = "Some Person", Birthday = DateTime.Now }; //Act logic.Create(person); Person saved = logic.GetById(1); //Assert Assert.IsNotNull(saved, "Person should not been null after insert or person found"); }