public void Setup() { applicationTokenId = Guid.NewGuid(); userId = Guid.NewGuid(); _authTokenRepository = new Mock<IAuthenticationTokenRepository>(); _authTokenRepository .Setup(x => x.Save(It.IsAny<AuthenticationToken>())); _appTokenRepository = new Mock<IApplicationTokenRepository>(); _appTokenRepository .Setup(x => x.GetById(applicationTokenId)) .Returns(new ApplicationToken() { Id = applicationTokenId }); _userRepository = new Mock<IUserRepository>(); _userRepository .Setup(x => x.GetById(userId)) .Returns(new User() { Id = userId, Role = new Role() }); _target = GetTarget(); }
public void Setup() { user = new User() { Role = new Role() }; authenticationTokenId = Guid.NewGuid(); _appTokenRepository = new Mock<IApplicationTokenRepository>(); _authTokenRepository = new Mock<IAuthenticationTokenRepository>(); _authTokenRepository .Setup(x => x.GetById(authenticationTokenId)) .Returns(new AuthenticationToken() { Id = authenticationTokenId, IsEnabled = true, ApplicationToken = new ApplicationToken(), ReasonForDeauthorisation = string.Empty, User = user }); _userRepository = new Mock<IUserRepository>(); _target = GetTarget(); }