コード例 #1
0
        public void Addressee_Service_GetById_Sucessfully()
        {
            //Arrange
            var addressee = ObjectMother.AddresseeValidWithIdWithAddress();

            _mockAddresseeRepository.Setup(er => er.GetById(addressee.Id)).Returns(addressee);

            //Action
            var pegarAddressee = _addresseeService.GetById(addressee.Id);

            //Assert
            _mockAddresseeRepository.Verify(er => er.GetById(addressee.Id), Times.Once);
            pegarAddressee.Should().NotBeNull();
            pegarAddressee.Id.Should().Be(addressee.Id);
        }
コード例 #2
0
 public IHttpActionResult GetById(int id)
 {
     return(HandleQuery <Addressee, AddresseeViewModel>(_service.GetById(id)));
 }