public void FindAllNoneFoundTest() { //arrange List <ContactResponseDTO> contactResponseDTOs = new List <ContactResponseDTO>(); contactResponseDTOs.Add(contactResponseDTO); var service = new ContactsService(_mockContactsRepo.Object, _mockContactsMapper.Object); //act var actual = service.FindAll(); //assert Assert.IsNull(actual); }
public void FindAllHappyPathTest() { //arrange List <ContactResponseDTO> contactResponseDTOs = new List <ContactResponseDTO>(); contactResponseDTOs.Add(contactResponseDTO); _mockContactsRepo.Setup(r => r.FindAll()).Returns(new List <ContactsEntity>()); _mockContactsMapper.Setup(r => r.convertEntityToDTO(It.IsAny <ContactsEntity>())).Returns(contactResponseDTO); var service = new ContactsService(_mockContactsRepo.Object, _mockContactsMapper.Object); //act var actual = service.FindAll(); //assert Assert.IsNotEmpty(contactResponseDTOs); }