Ejemplo n.º 1
0
        public void ReturnNull_WhenEmailIsNullOrEmpty(string testEmail)
        {
            //Arrange
            var usersRepoMock      = new Mock <IEfRepository <RegularUser> >();
            var regularUserService = new Services.RegularUserService(usersRepoMock.Object);

            //Act && Assert
            Assert.IsNull(regularUserService.GetByEmail(testEmail));
        }
Ejemplo n.º 2
0
        public void CallRegularUserRepoFindOnce_WhenEmailIsValid()
        {
            //Arrange
            var usersRepoMock      = new Mock <IEfRepository <RegularUser> >();
            var regularUserService = new Services.RegularUserService(usersRepoMock.Object);
            var email = Guid.NewGuid().ToString();

            //Act
            regularUserService.GetByEmail(email);

            //Assert
            usersRepoMock.Verify(m => m.All, Times.Once);
        }