public void Repository_Snack_deveria_retornar_um_snack() { //Arrange Snack snack = _repository.Add(_snack); //Action Snack result = _repository.GetById(snack.Id); //Assert result.Name.Should().Be(snack.Name); result.Id.Should().Be(snack.Id); }
public void Snacks_Repository_Should_Get_By_Id_Sucessfully() { //Action var snack = _repository.GetById(_snackBase.Id); //Assert snack.Should().NotBeNull(); snack.Should().Be(_snackBase); }
internal Snack Get(int id) { Snack snack = _repo.GetById(id); if (snack == null) { throw new Exception("invalid Id"); } return(snack); }