public void GetByIdInvalido() { //Arrange int id = 0; DireccionService service = new DireccionService(_repository.Object, _query.Object); //Act var result = service.GetByID(id); //Assert Assert.IsNull(result); //result.Should().BeNull(); }
public void GetByIdValido() { //Arrange int id = new Random().Next(1, 100); _query.Setup(_ => _.GetByID(id)).Returns(new ResponseGetDireccion() { Calle = "Alguna calle" }); DireccionService service = new DireccionService(_repository.Object, _query.Object); //Act var result = service.GetByID(id); //Assert Assert.IsNotNull(result); }