Example #1
0
        public void GetManufacturer_Calls_GetManufacturer_In_Service()
        {
            var testId = 1;

            manufacturerController.GetManufacturer(testId);
            mockService.Verify(s => s.GetManufacturer(It.IsAny <int>()), Times.Once);
        }
        public async Task Get_ReturnCorrectManufacturer()
        {
            _mockRepositoryManufacturer.Setup(x => x.GetManufacturer(1)).ReturnsAsync(_manufacturers[0]);

            var result = await _manufacturerController.GetManufacturer(_manufacturers[0].ManufacturerId);

            Assert.AreEqual(_manufacturers[0].Name, result.Value.Name);
        }