public void GetStatusByDescription_returns_StatusDto() { var desc = "test"; var entity = new BicycleShop.Data.Model.Statuses.StatusEntity(); var dto = new StatusDto(); mockRepo.Setup(r => r.GetByDescription(It.IsAny <string>())).Returns(entity); mockMapper.Setup(m => m.Map <StatusDto>(entity)).Returns(dto); StatusDto actual = statusService.GetStatusByDescription(desc); Assert.AreEqual(dto, actual); }
public void GetStatus_Returns_StatusDto() { var id = 1; var entity = new BicycleShop.Data.Model.Statuses.StatusEntity(); var dto = new StatusDto(); mockRepo.Setup(r => r.GetById(It.IsAny <int>())).Returns(entity); mockMapper.Setup(m => m.Map <StatusDto>(entity)).Returns(dto); StatusDto actual = statusService.GetStatus(id); Assert.AreEqual(dto, actual); }