示例#1
0
        public async Task GroupVariablesRetrieved()
        {
            //arrange
            var createdVariable = await _sut.CreateVariableAsync(GitLabApiHelper.TestGroupId, new CreateGroupVariableRequest
            {
                VariableType = "env_var",
                Key          = "SOME_VAR_KEY_RETRIEVE",
                Value        = "VALUE_VAR",
                Masked       = true,
                Protected    = true
            });

            VariableIdsToClean.Add(createdVariable.Key);

            //act
            var variables = await _sut.GetVariablesAsync(GitLabApiHelper.TestGroupId);

            var variable = variables.First(v => v.Key == createdVariable.Key);

            //assert
            variables.Should().NotBeEmpty();
            variable.Should().Match <Variable>(v =>
                                               v.VariableType == createdVariable.VariableType &&
                                               v.Key == createdVariable.Key &&
                                               v.Value == createdVariable.Value &&
                                               v.Masked == createdVariable.Masked &&
                                               v.Protected == createdVariable.Protected);
        }