diff --git a/README.md b/README.md index 20b5100..98c3057 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ The repository contains new versions of adaptors for dotnet test frameworks. | 4.5 | 1.1 | 1.1 | 1.1 | | 4.6 | 1.4 | 1.4 | 1.4 | | 5.0 | 1.6 | 1.6 | 1.6 | +| 5.2 | 1.7 | 1.7 | 1.7 | Supported test frameworks : diff --git a/Tms.Adapter.Core/Client/Converter.cs b/Tms.Adapter.Core/Client/Converter.cs index d3f614e..bc2e7f2 100644 --- a/Tms.Adapter.Core/Client/Converter.cs +++ b/Tms.Adapter.Core/Client/Converter.cs @@ -1,15 +1,17 @@ using TestIT.ApiClient.Model; using Tms.Adapter.Core.Models; +using Link = Tms.Adapter.Core.Models.Link; using LinkType = TestIT.ApiClient.Model.LinkType; +using StepResult = Tms.Adapter.Core.Models.StepResult; namespace Tms.Adapter.Core.Client; public static class Converter { - public static CreateAutoTestRequest ConvertAutoTestDtoToPostModel(TestContainer result, ClassContainer container, + public static AutoTestPostModel ConvertAutoTestDtoToPostModel(TestContainer result, ClassContainer container, string projectId) { - return new CreateAutoTestRequest(externalId: result.ExternalId, name: result.DisplayName) + return new AutoTestPostModel(externalId: result.ExternalId, name: result.DisplayName) { ExternalId = result.ExternalId, Links = ConvertLinksToPostModel(result.Links), @@ -25,10 +27,10 @@ public static CreateAutoTestRequest ConvertAutoTestDtoToPostModel(TestContainer }; } - public static UpdateAutoTestRequest ConvertAutoTestDtoToPutModel(TestContainer result, ClassContainer container, + public static AutoTestPutModel ConvertAutoTestDtoToPutModel(TestContainer result, ClassContainer container, string projectId) { - return new UpdateAutoTestRequest(externalId: result.ExternalId, name: result.DisplayName) + return new AutoTestPutModel(externalId: result.ExternalId, name: result.DisplayName) { ExternalId = result.ExternalId, Links = ConvertLinksToPutModel(result.Links), diff --git a/Tms.Adapter.Core/Client/ITmsClient.cs b/Tms.Adapter.Core/Client/ITmsClient.cs index 75a0b45..dc1166d 100644 --- a/Tms.Adapter.Core/Client/ITmsClient.cs +++ b/Tms.Adapter.Core/Client/ITmsClient.cs @@ -1,5 +1,6 @@ using TestIT.ApiClient.Model; using Tms.Adapter.Core.Models; +using Link = Tms.Adapter.Core.Models.Link; namespace Tms.Adapter.Core.Client; diff --git a/Tms.Adapter.Core/Client/TmsClient.cs b/Tms.Adapter.Core/Client/TmsClient.cs index de9dadb..1c417f3 100644 --- a/Tms.Adapter.Core/Client/TmsClient.cs +++ b/Tms.Adapter.Core/Client/TmsClient.cs @@ -4,6 +4,7 @@ using TestIT.ApiClient.Model; using Tms.Adapter.Core.Configurator; using Tms.Adapter.Core.Models; +using Link = Tms.Adapter.Core.Models.Link; using LinkType = TestIT.ApiClient.Model.LinkType; namespace Tms.Adapter.Core.Client; @@ -121,7 +122,7 @@ public async Task LinkAutoTestToWorkItems(string autotestId, IEnumerable { try { - await _autoTests.LinkAutoTestToWorkItemAsync(autotestId, new LinkAutoTestToWorkItemRequest(workItemId ?? string.Empty)).ConfigureAwait(false); + await _autoTests.LinkAutoTestToWorkItemAsync(autotestId, new WorkItemIdModel(workItemId ?? string.Empty)).ConfigureAwait(false); _logger.LogDebug( "Link autotest {AutotestId} to workitem {WorkitemId} is successfully", autotestId, @@ -217,12 +218,12 @@ public async Task CreateTestRun() return; } - var createTestRunRequestBody = new CreateEmptyRequest + var testRunV2PostShortModel = new TestRunV2PostShortModel { ProjectId = new Guid(_settings.ProjectId), Name = (string.IsNullOrEmpty(_settings.TestRunName) ? null : _settings.TestRunName)! }; - var testRun = await _testRuns.CreateEmptyAsync(createTestRunRequestBody); + var testRun = await _testRuns.CreateEmptyAsync(testRunV2PostShortModel); _settings.TestRunId = testRun.Id.ToString(); diff --git a/Tms.Adapter.Core/Tms.Adapter.Core.csproj b/Tms.Adapter.Core/Tms.Adapter.Core.csproj index 3031048..1898df4 100644 --- a/Tms.Adapter.Core/Tms.Adapter.Core.csproj +++ b/Tms.Adapter.Core/Tms.Adapter.Core.csproj @@ -1,7 +1,7 @@  - 1.6.5 + 1.7.0 netstandard2.1 enable true @@ -48,7 +48,7 @@ - + diff --git a/Tms.Adapter.CoreTests/Client/ConverterTests.cs b/Tms.Adapter.CoreTests/Client/ConverterTests.cs index 1dc78a2..f751f3a 100644 --- a/Tms.Adapter.CoreTests/Client/ConverterTests.cs +++ b/Tms.Adapter.CoreTests/Client/ConverterTests.cs @@ -24,7 +24,7 @@ public void ConvertAutoTestDtoToPostModel() var actual = Converter.ConvertAutoTestDtoToPostModel(testContainer, classContainer, id); // Assert - Assert.IsInstanceOfType(actual); + Assert.IsInstanceOfType(actual); Assert.IsNotNull(actual); } @@ -64,7 +64,7 @@ public void ConvertAutoTestDtoToPutModel() var actual = Converter.ConvertAutoTestDtoToPutModel(testContainer, classContainer, id); // Assert - Assert.IsInstanceOfType(actual); + Assert.IsInstanceOfType(actual); Assert.IsNotNull(actual); } } \ No newline at end of file diff --git a/Tms.Adapter.SpecFlowPlugin/Tms.Adapter.SpecFlowPlugin.csproj b/Tms.Adapter.SpecFlowPlugin/Tms.Adapter.SpecFlowPlugin.csproj index 6e74b04..896ef7f 100644 --- a/Tms.Adapter.SpecFlowPlugin/Tms.Adapter.SpecFlowPlugin.csproj +++ b/Tms.Adapter.SpecFlowPlugin/Tms.Adapter.SpecFlowPlugin.csproj @@ -1,7 +1,7 @@  - 1.6.5 + 1.7.0 netstandard2.1 enable true diff --git a/Tms.Adapter.XUnit/Tms.Adapter.XUnit.csproj b/Tms.Adapter.XUnit/Tms.Adapter.XUnit.csproj index 02fa370..dae938e 100644 --- a/Tms.Adapter.XUnit/Tms.Adapter.XUnit.csproj +++ b/Tms.Adapter.XUnit/Tms.Adapter.XUnit.csproj @@ -1,7 +1,7 @@  - 1.6.5 + 1.7.0 netstandard2.1 enable true diff --git a/Tms.Adapter/Tms.Adapter.csproj b/Tms.Adapter/Tms.Adapter.csproj index 3ed921b..ecf9cb4 100644 --- a/Tms.Adapter/Tms.Adapter.csproj +++ b/Tms.Adapter/Tms.Adapter.csproj @@ -1,7 +1,7 @@  - 1.6.5 + 1.7.0 netstandard2.1 enable true diff --git a/TmsRunner/Managers/TmsManager.cs b/TmsRunner/Managers/TmsManager.cs index 2183057..a0e8c41 100644 --- a/TmsRunner/Managers/TmsManager.cs +++ b/TmsRunner/Managers/TmsManager.cs @@ -5,6 +5,7 @@ using TmsRunner.Entities; using TmsRunner.Entities.AutoTest; using TmsRunner.Utils; +using AutoTest = TmsRunner.Entities.AutoTest.AutoTest; namespace TmsRunner.Managers; @@ -19,15 +20,15 @@ public sealed class TmsManager(ILogger logger, public async Task CreateTestRunAsync() { - var createTestRunRequestBody = new CreateEmptyRequest + var testRunV2PostShortModel = new TestRunV2PostShortModel { ProjectId = new Guid(settings.ProjectId ?? string.Empty), Name = (string.IsNullOrEmpty(settings.TestRunName) ? null : settings.TestRunName)! }; - logger.LogDebug("Creating test run {@TestRun}", createTestRunRequestBody); + logger.LogDebug("Creating test run {@TestRun}", testRunV2PostShortModel); - var testRun = await testRunsApi.CreateEmptyAsync(createTestRunRequestBody).ConfigureAwait(false) ?? throw new Exception($"Could not find project with id: {settings.ProjectId}"); + var testRun = await testRunsApi.CreateEmptyAsync(testRunV2PostShortModel).ConfigureAwait(false) ?? throw new Exception($"Could not find project with id: {settings.ProjectId}"); logger.LogDebug("Created test run {@TestRun}", testRun); return testRun.Id.ToString(); @@ -136,7 +137,7 @@ public async Task LinkAutoTestToWorkItemAsync(string autotestId, IEnumerable - 1.6.5 + 1.7.0 Exe enable enable @@ -48,7 +48,7 @@ - + diff --git a/TmsRunner/Utils/Converter.cs b/TmsRunner/Utils/Converter.cs index 954af4e..6ee39ec 100644 --- a/TmsRunner/Utils/Converter.cs +++ b/TmsRunner/Utils/Converter.cs @@ -1,11 +1,14 @@ using TestIT.ApiClient.Model; using TmsRunner.Entities.AutoTest; +using AutoTest = TmsRunner.Entities.AutoTest.AutoTest; +using AutoTestStep = TmsRunner.Entities.AutoTest.AutoTestStep; +using AutoTestStepResult = TmsRunner.Entities.AutoTest.AutoTestStepResult; namespace TmsRunner.Utils; public static class Converter { - public static CreateAutoTestRequest ConvertAutoTestDtoToPostModel(AutoTest autotest, string? projectId) + public static AutoTestPostModel ConvertAutoTestDtoToPostModel(AutoTest autotest, string? projectId) { var links = autotest.Links?.Select(l => new LinkPostModel( @@ -15,7 +18,7 @@ public static CreateAutoTestRequest ConvertAutoTestDtoToPostModel(AutoTest autot Enum.Parse(l.Type.ToString()!)) ).ToList(); - return new CreateAutoTestRequest(externalId: autotest.ExternalId ?? string.Empty, name: autotest.Name ?? string.Empty) + return new AutoTestPostModel(externalId: autotest.ExternalId ?? string.Empty, name: autotest.Name ?? string.Empty) { ExternalId = autotest.ExternalId ?? string.Empty, Links = links!, @@ -31,7 +34,7 @@ public static CreateAutoTestRequest ConvertAutoTestDtoToPostModel(AutoTest autot }; } - public static UpdateAutoTestRequest ConvertAutoTestDtoToPutModel(AutoTest autotest, string? projectId) + public static AutoTestPutModel ConvertAutoTestDtoToPutModel(AutoTest autotest, string? projectId) { var links = autotest.Links?.Select(l => new LinkPutModel( @@ -42,7 +45,7 @@ public static UpdateAutoTestRequest ConvertAutoTestDtoToPutModel(AutoTest autote ).ToList(); - return new UpdateAutoTestRequest(externalId: autotest.ExternalId ?? string.Empty, name: autotest.Name ?? string.Empty) + return new AutoTestPutModel(externalId: autotest.ExternalId ?? string.Empty, name: autotest.Name ?? string.Empty) { Links = links ?? [], ProjectId = new Guid(projectId ?? string.Empty), diff --git a/TmsRunnerTests/Utils/ConverterTests.cs b/TmsRunnerTests/Utils/ConverterTests.cs index 216c43c..818dc58 100644 --- a/TmsRunnerTests/Utils/ConverterTests.cs +++ b/TmsRunnerTests/Utils/ConverterTests.cs @@ -1,7 +1,8 @@ using Microsoft.VisualStudio.TestPlatform.ObjectModel; using TestIT.ApiClient.Model; -using TmsRunner.Entities.AutoTest; using TmsRunner.Utils; +using AutoTest = TmsRunner.Entities.AutoTest.AutoTest; +using AutoTestResult = TmsRunner.Entities.AutoTest.AutoTestResult; namespace TmsRunnerTests.Utils; @@ -37,7 +38,7 @@ public void ConvertAutoTestDtoToPutModel() var actual = Converter.ConvertAutoTestDtoToPutModel(autotest, id); // Assert - Assert.IsInstanceOfType(actual); + Assert.IsInstanceOfType(actual); Assert.IsNotNull(actual); } @@ -52,7 +53,7 @@ public void ConvertAutoTestDtoToPostModel() var actual = Converter.ConvertAutoTestDtoToPostModel(autotest, id); // Assert - Assert.IsInstanceOfType(actual); + Assert.IsInstanceOfType(actual); Assert.IsNotNull(actual); } } \ No newline at end of file