Exemplo n.º 1
0
 protected new void SetUp(CinemaDbContext cinemaDbContext)
 {
     base.SetUp(cinemaDbContext);
     EncrypterMock.Setup(m => m.Compute(User.Password, It.IsAny <string>()))
     .Returns((string pass, string salt) => pass);
     EncrypterMock.Setup(m => m.Compare(User.Password, User.Password)).Returns(true);
     cinemaDbContext.Add(User);
     cinemaDbContext.SaveChanges();
     UserService = new Cinema.Services.UserService(cinemaDbContext, EncrypterMock.Object, TokenProviderMock.Object, Mapper, MemoryCache, EmailSenderMock.Object);
 }
Exemplo n.º 2
0
 public void Init()
 {
     unitOfWork         = new UnitOfWorkMock();
     mailHelper         = new MailHelperMock();
     jwtDecoder         = new JwtDecoderMock();
     encrypter          = new EncrypterMock();
     cache              = new CacheMock();
     controller         = new UserApiController(unitOfWork, mailHelper, new ApiClientMock(), jwtDecoder, encrypter, cache);
     controller.Request = new HttpRequestMessage();
 }