Exemplo n.º 1
0
        public GivenAnEntityTypeClientInstance()
        {
            IApplicationContext  applicationContext  = new ApplicationContext();
            IConfigurationRoot   configurationRoot   = ConfigurationRootFactory.Create(applicationContext);
            IConfigurationGetter configurationGetter = new ConfigurationGetter(configurationRoot);

            var projectContextOptions = configurationGetter.GetOptions <ProjectContextOptions>();
            var clientOptions         = configurationGetter.GetOptions <CsomClientOptions>();

            var projectContext = ProjectContextFactory.Build(projectContextOptions);

            _client = new EntityTypeClient(projectContext, clientOptions);
        }
Exemplo n.º 2
0
        public GivenATaskClientInstance()
        {
            IApplicationContext  applicationContext  = new ApplicationContext();
            IConfigurationRoot   configurationRoot   = ConfigurationRootFactory.Create(applicationContext);
            IConfigurationGetter configurationGetter = new ConfigurationGetter(configurationRoot);

            var projectContextOptions = configurationGetter.GetOptions <ProjectContextOptions>();
            var clientOptions         = configurationGetter.GetOptions <CsomClientOptions>();

            var projectContext = ProjectContextFactory.Build(projectContextOptions);

            _projectClient     = new ProjectClient(projectContext, clientOptions);
            _client            = new TaskClient(projectContext, clientOptions);
            _customFieldClient = new CustomFieldClient(projectContext, clientOptions);
            _entityTypeClient  = new EntityTypeClient(projectContext, clientOptions);

            _publishedProject = CreateTestProject().Result;
        }