Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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);
        }