Пример #1
0
        public async System.Threading.Tasks.Task WhenGetAllAsync_ThenEnterpriseResourcesAreReturned()
        {
            // ACT
            var result = await _client.GetAllAsync();

            // ASSERT
            Assert.NotNull(result);
        }
        public async System.Threading.Tasks.Task WhenLinkToEnterpriseResourceAsync_ThenTrueIsReturned()
        {
            // ARRANGE
            var projectModel = new ProjectModel()
            {
                Id   = Guid.NewGuid(),
                Name = NamePrefix + Guid.NewGuid().ToString()
            };
            var enterpriseResource = (await _enterpriseResourceClient.GetAllAsync()).First();

            // ACT
            var publishedProject = await _client.AddAsync(projectModel);

            var result = await _client.LinkToEnterpriseResource(publishedProject, enterpriseResource);

            // ASSERT
            Assert.NotNull(result);
        }
        public void Dispose()
        {
            // NOTE: THIS WILL WORK ONLY IF GETALL AND REMOVE METHOD WORKS

            // Clean all published projects created for the text execution
            var publishedProject = _projectClient.GetAllAsync().Result;

            foreach (var createdProject in publishedProject.Where(pp => pp.Name.StartsWith(PrjNamePrefix)))
            {
                _projectClient.RemoveAsync(createdProject).Wait();
            }

            // Clean all enterprise resources created for the text execution
            var enterpriseResources = _resourceClient.GetAllAsync().Result;

            foreach (var enterpriseResource in enterpriseResources.Where(pp => pp.Name.StartsWith(ResNamePrefix)))
            {
                _resourceClient.RemoveAsync(enterpriseResource).Wait();
            }
        }