Esempio n. 1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiProjectModelMapper();
            var model  = new ApiProjectResponseModel();

            model.SetProperties("A", true, BitConverter.GetBytes(1), "A", true, "A", true, "A", "A", "A", "A", "A", "A");
            ApiProjectRequestModel response = mapper.MapResponseToRequest(model);

            response.AutoCreateRelease.Should().Be(true);
            response.DataVersion.Should().BeEquivalentTo(BitConverter.GetBytes(1));
            response.DeploymentProcessId.Should().Be("A");
            response.DiscreteChannelRelease.Should().Be(true);
            response.IncludedLibraryVariableSetIds.Should().Be("A");
            response.IsDisabled.Should().Be(true);
            response.JSON.Should().Be("A");
            response.LifecycleId.Should().Be("A");
            response.Name.Should().Be("A");
            response.ProjectGroupId.Should().Be("A");
            response.Slug.Should().Be("A");
            response.VariableSetId.Should().Be("A");
        }
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiProjectModelMapper mapper = new ApiProjectModelMapper();

            UpdateResponse <ApiProjectResponseModel> updateResponse = await this.Client.ProjectUpdateAsync(model.Id, mapper.MapResponseToRequest(model));

            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();

            await this.Cleanup();
        }