示例#1
0
        public void CreateProject_ReturnsSucessfulResult()
        {
            _group = new Group()
            {
                Name        = "Divisions",
                Description = "Divisions system",
                Path        = "Divisions",
                Visibility  = GroupVisibility.Private
            };

            _json = ParseObjectTojson(_group);
            var createGroupResult = Sut.CreateGroup(_json);

            createGroupResult.Wait();

            _project = new Project()
            {
                Name        = "Admin",
                Description = "Divisions Admin system",
                Path        = "Admin",
                GroupId     = createGroupResult.Result.Id,
                Visibility  = GroupVisibility.Private
            };

            _json = ParseObjectTojson(_project);
            var result = Sut.Create(_json);

            result.Wait();
            _projectId = result.Result.Id;

            Assert.That(_groupId, Is.Not.Empty);
        }
        public async Task <Project> ExecuteAsync(Project project)
        {
            var serializerSettings =
                new JsonSerializerSettings {
                ContractResolver = new CamelCasePropertyNamesContractResolver()
            };
            var json = JsonConvert.SerializeObject(project, serializerSettings);

            return(await _gitLabService.Create(json));
        }