public void DoctorExistsTest() { int UserId = 1; var fakeRepositoryMock = new Mock <IDoctorRepository>(); fakeRepositoryMock.Setup(x => x.DoctorExists(UserId)).Returns(true); var doctorService = new DoctorService(fakeRepositoryMock.Object); var isExist = doctorService.DoctorExists(UserId); Assert.True(isExist); }