Document version endpoints (#15946)

* Rename/Move/duplicate PaginationService to facilitate conversion closer to the data layer

Duplication is because of internal modifier as we don't want to expose these temporary classes

* Move Guid to Int Extensions into core + add unittests

* Added Document version endpoints

Updated used services to use async methods

* Moved PaginationConverter into core so it can be used by the service layer

* Endpoint structure improvements

* Updating OpenApi.json

* Add greedy constructors for contentService tests

* Namespace changes and naming cleanup

* Update openapispec again...

* Refactor injected services

* PR suggestion updates

- Move endpoints into their own structural section as they are also in a different swagger section
- Naming improvements
- Allign PresentationFactories with similar classes
- Cleanup unused assignments
- Cleanup refactoring comments
- Improve obsoletion remarks

* Cleanup

* ResponseModel improvements

* OpenApi spec update

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
Co-authored-by: Elitsa <elm@umbraco.dk>
This commit is contained in:
Sven Geusens
2024-04-02 12:12:36 +02:00
committed by GitHub
parent 1866b61e12
commit 95849c265b
21 changed files with 1136 additions and 15 deletions

View File

@@ -0,0 +1,29 @@
using NUnit.Framework;
using Umbraco.Cms.Core.Extensions;
using Umbraco.Extensions;
namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Extensions;
[TestFixture]
public class IntGuidIntConversionTests
{
[TestCase(int.MinValue)]
[TestCase(int.MaxValue)]
[TestCase(int.MinValue / 2)]
[TestCase(int.MinValue / 5)]
[TestCase(int.MinValue / 707)]
[TestCase(int.MinValue / 1313)]
[TestCase(int.MinValue / 17017)]
[TestCase(int.MaxValue / 2)]
[TestCase(int.MaxValue / 5)]
[TestCase(int.MaxValue / 707)]
[TestCase(int.MaxValue / 1313)]
[TestCase(int.MaxValue / 17017)]
public void IntoToGuidToInt_NoChange(int startValue)
{
var intermediateValue = startValue.ToGuid();
var endValue = intermediateValue.ToInt();
Assert.AreEqual(startValue, endValue);
}
}