public void GetManufacturer_Returns_Ok_Result() { var testId = 1; var resources = new ManufacturerResource(); mockService.Setup(s => s.GetManufacturer(It.IsAny <int>())).Returns(new ManufacturerDto()); mockMapper.Setup(m => m.Map <ManufacturerResource>(It.IsAny <ManufacturerDto>())).Returns(resources); var result = manufacturerController.GetManufacturer(testId) as OkObjectResult; Assert.IsNotNull(result); Assert.AreEqual(200, result.StatusCode); }
public void GetManufacturer_Returns_NotEmpty_List() { var testId = 1; var resources = new ManufacturerResource(); mockService.Setup(s => s.GetManufacturer(It.IsAny <int>())).Returns(new ManufacturerDto()); mockMapper.Setup(m => m.Map <ManufacturerResource>(It.IsAny <ManufacturerDto>())).Returns(resources); var result = manufacturerController.GetManufacturer(testId) as OkObjectResult; var actual = result.Value as ManufacturerResource; Assert.AreEqual(resources, actual); }