示例#1
0
        public override void Given()
        {
            Instance =
                new IdentityAliasValueConverter(
                    new MockIdentityManagementService(new Dictionary <string, ITeamFoundationIdentity>
            {
                { "alias", new MockTeamFoundationIdentity(MockIdentityDescriptor.Create("alias", "domain", "tenant"), "An Alias", Guid.Empty) },
                { "other", new MockTeamFoundationIdentity(MockIdentityDescriptor.Create("other", "domain", "tenant"), "AnOther Alias", Guid.Empty) }
            }), "tenant", "domain");

            base.Given();
        }
示例#2
0
        /// <inheritdoc />
        public override void Given()
        {
            base.Given();

            var soapIms    = ((IInternalTeamProjectCollection)Soap.TeamProjectCollection).GetService <IIdentityManagementService2>().AsProxy();
            var translator = new WiqlTranslator();
            var idMapper   = new IdentityAliasValueConverter(soapIms, IntegrationSettings.TenantId, IntegrationSettings.Domains);
            var visitors   = new ExpressionVisitor[] { new PartialEvaluator(), new IdentityMappingVisitor(idMapper), new QueryRewriter() };

            var soapBuilder = new WiqlQueryBuilder(translator, visitors);
            var soapQp      = new TeamFoundationServerWorkItemQueryProvider(Soap, soapBuilder);

            SoapQueryable = new Query <IWorkItem>(soapQp, soapBuilder);

            var restBuilder = new WiqlQueryBuilder();
            var restQp      = new TeamFoundationServerWorkItemQueryProvider(Rest, restBuilder);

            RestQueryable = new Query <IWorkItem>(restQp, restBuilder);
        }