Пример #1
0
        public void ToApiDeletePreviousVersionsRequest()
        {
            // ARRANGE
            ApiDeletePreviousVersionsRequest expected = FactoryNode.ApiDeletePreviousVersionsRequest;

            DeletePreviousVersionsRequest param = new DeletePreviousVersionsRequest(expected.VersionsToBeDeleted);

            // ACT
            ApiDeletePreviousVersionsRequest actual = NodeMapper.ToApiDeletePreviousVersionsRequest(param);

            // ASSERT
            Assert.Equal(expected, actual, new ApiDeletePreviousVersionsRequestComparer());
        }
Пример #2
0
        public void DeletePreviousVersions(DeletePreviousVersionsRequest request)
        {
            _client.Executor.CheckApiServerVersion();

            #region Parameter Validation

            request.MustNotNull(nameof(request));
            request.VersionIds.EnumerableMustNotNullOrEmpty(nameof(request.VersionIds));
            request.VersionIds.ForEach(id => id.MustPositive(nameof(request.VersionIds) + " element"));

            #endregion

            ApiDeletePreviousVersionsRequest apiRequest = NodeMapper.ToApiDeletePreviousVersionsRequest(request);
            IRestRequest restRequest = _client.Builder.DeletePreviousVersion(apiRequest);
            _client.Executor.DoSyncApiCall <VoidResponse>(restRequest, RequestType.DeletePreviousVersions);
        }