public void ManufacturerExistsTest() { int UserId = 1; var fakeRepositoryMock = new Mock <IManufacturerRepository>(); fakeRepositoryMock.Setup(x => x.ManufacturerExists(UserId)).Returns(true); var manufacturerService = new ManufacturerService(fakeRepositoryMock.Object); var isExist = manufacturerService.ManufacturerExists(UserId); Assert.True(isExist); }