public void it_faces_exceptions_projectFeatures_field_when_unauthorized()
        {
            string projectId = "_Root";
            string featureId = "PROJECT_EXT_1";

            PropertyField       propertyField       = PropertyField.WithFields(name: true, value: true, inherited: true);
            PropertiesField     propertiesField     = PropertiesField.WithFields(propertyField: propertyField);
            ProjectFeatureField projectFeatureField =
                ProjectFeatureField.WithFields(type: true, properties: propertiesField);

            try
            {
                m_client.Projects.GetFields(projectFeatureField.ToString())
                .GetProjectFeatureByProjectFeature(projectId, featureId);
            }
            catch (HttpException e)
            {
                Console.WriteLine(e);
                Assert.That(e.ResponseStatusCode == HttpStatusCode.Forbidden);
            }
            catch (Exception e)
            {
                Assert.Fail("GetFields faced an unexpected exception", e);
            }
        }
Esempio n. 2
0
        public void it_returns_projectFeatures_field()
        {
            string projectId = "_Root";
            string featureId = "PROJECT_EXT_1";

            PropertyField       propertyField       = PropertyField.WithFields(name: true, value: true, inherited: true);
            PropertiesField     propertiesField     = PropertiesField.WithFields(propertyField: propertyField);
            ProjectFeatureField projectFeatureField = ProjectFeatureField.WithFields(type: true, properties: propertiesField);

            ProjectFeature projectFeature = m_client.Projects.GetFields(projectFeatureField.ToString()).GetProjectFeatureByProjectFeature(projectId, featureId);

            Assert.That(projectFeature != null, "No project feature found for that specific project");
            Assert.That(projectFeature.Type != null, "Bad Value type");
            Assert.That(projectFeature.Properties != null, "Bad Value type");
            Assert.That(projectFeature.Href == null, "Bad Value type");
            Assert.That(projectFeature.Id == null, "Bad Value type");
        }