public void Invoke_NullEmail_ReturnsZero() { // prepare var mockedUserRepository = new Mock <IUserRepository>(); var action = new GetUserId(mockedUserRepository.Object); // action var userId = action.Invoke(null); // check Assert.Equal(0, userId); }
public void Invoke_EmptyRepository_ReturnsZero() { // prepare var findByResult = new List <DataAccess.Models.User>(); var mockedUserRepository = new Mock <IUserRepository>(); mockedUserRepository.Setup(r => r.FindBy(It.IsAny <Expression <Func <DataAccess.Models.User, bool> > >())) .Returns(findByResult.AsQueryable); var action = new GetUserId(mockedUserRepository.Object); // action var userId = action.Invoke("*****@*****.**"); // check Assert.Equal(0, userId); }