public void ReturnNull_WhenIdIsNullOrEmpty(string testId) { //Arrange var usersRepoMock = new Mock <IEfRepository <RegularUser> >(); var regularUserService = new Services.RegularUserService(usersRepoMock.Object); //Act && Assert Assert.IsNull(regularUserService.GetById(testId)); }
public void CallRegularUserRepoFindOnce_WhenIdIsValid() { //Arrange var usersRepoMock = new Mock <IEfRepository <RegularUser> >(); var regularUserService = new Services.RegularUserService(usersRepoMock.Object); var id = Guid.NewGuid().ToString(); //Act regularUserService.GetById(id); //Assert usersRepoMock.Verify(m => m.GetById(id), Times.Once); }