Ejemplo n.º 1
0
        public void AgencyQueryServiceClassSetUp()
        {
            _factory             = new MockRepository(MockBehavior.Loose);
            _unitOfWorkAdmin     = _factory.Create <IAdministrationUnitOfWork>();
            _jurisdiction        = new Jurisdiction("ori", "agencyCode");
            _agency              = new AgencyDerived(_jurisdiction, "name");
            _agencyConfiguration = new AgencyConfigurationDerived(_agency, "name");
            _rmsSystem           = new RMSSystem(Guid.NewGuid(), "description");
            _user = _rmsSystem.CreateUserAccount(_agency, "username", "password");
            _unitOfWorkAdmin.Setup(item => item.Find <Agency>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>()))
            .Returns(_agency);

            _unitOfWorkAdmin.Setup(item => item.Find <User>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>()))
            .Returns(_user);

            _authorizationPolicy = new Mock <IServiceAuthorizationPolicy>();
            _identityProvider    = new Mock <IServiceIdentityProvider>();

            var identityContext = new IdentityContext()
            {
                IdentityId = Guid.NewGuid()
            };

            _identityProvider.Setup(x => x.GetPrincipalIdentifier()).Returns(identityContext.IdentityId);
            _identityProvider.Setup(x => x.GetIdentityContext()).Returns(identityContext);


            _iPasswordQueryService = new PasswordQueryService(_unitOfWorkAdmin.Object, Mock.Of <ILog>(), _authorizationPolicy.Object, _identityProvider.Object);
            SetUpAgencyPasswordConfiguration();
        }
Ejemplo n.º 2
0
 public PasswordController(IPasswordQueryService passwordQueryService, IUserQueryService usrQueryService)
 {
     _passwordQueryService = passwordQueryService;
     _userQrySvc           = usrQueryService;
 }