public void DeleteRefoodUserById_Success_Test() { // Arrange int id = 1; // create mock for repository var mock = new Mock <IRefoodUserRepository>(); mock.Setup(s => s.DeleteRefoodUser(Moq.It.IsAny <int>())).Verifiable(); // service RefoodUserService refoodUserService = new RefoodUserService(); RefoodUserService.Repository = mock.Object; // Act refoodUserService.DeleteRefoodUser(id); // Assert Assert.IsTrue(true); }
public void DeleteRefoodUser_Success_Test() { // Arrange RefoodUserDTO dto = SampleRefoodUserDTO(1); dto.IsDeleted = false; // create mock for repository var mock = new Mock <IRefoodUserRepository>(); mock.Setup(s => s.DeleteRefoodUser(Moq.It.IsAny <R_RefoodUser>())).Verifiable(); // service RefoodUserService refoodUserService = new RefoodUserService(); RefoodUserService.Repository = mock.Object; // Act refoodUserService.DeleteRefoodUser(dto); // Assert Assert.IsTrue(true); }