From 8df844153b114b4cb8d06b703833b961fd7b4204 Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Tue, 16 Jul 2024 17:52:13 +0100 Subject: [PATCH 1/2] Disable integration tests (#197) * Update TrackingTests.cs * Update FlowTests.cs * Update OrdersTests.cs * Update deep-source.yml --- .github/workflows/deep-source.yml | 4 +- .../GuiStracini.Mandae.Tests/V2/FlowTests.cs | 252 +++++++++--------- .../V2/OrdersTests.cs | 100 +++---- .../V2/TrackingTests.cs | 164 ++++++------ 4 files changed, 260 insertions(+), 260 deletions(-) diff --git a/.github/workflows/deep-source.yml b/.github/workflows/deep-source.yml index 638a1cb..f958fc2 100644 --- a/.github/workflows/deep-source.yml +++ b/.github/workflows/deep-source.yml @@ -24,7 +24,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: '7.0.x' + dotnet-version: '8.0.x' - name: Build and analyze if: >- @@ -42,4 +42,4 @@ jobs: run: | dotnet build -c Debug --verbosity minimal dotnet test -c Debug --verbosity minimal --no-build --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat="cobertura" - ./bin/deepsource report --analyzer test-coverage --key csharp --value-file ./Tests/GuiStracini.Mandae.Tests/coverage.cobertura.xml \ No newline at end of file + ./bin/deepsource report --analyzer test-coverage --key csharp --value-file ./Tests/GuiStracini.Mandae.Tests/coverage.cobertura.xml diff --git a/Tests/GuiStracini.Mandae.Tests/V2/FlowTests.cs b/Tests/GuiStracini.Mandae.Tests/V2/FlowTests.cs index 20fd268..9015319 100644 --- a/Tests/GuiStracini.Mandae.Tests/V2/FlowTests.cs +++ b/Tests/GuiStracini.Mandae.Tests/V2/FlowTests.cs @@ -1,130 +1,130 @@ -// *********************************************************************** -// Assembly : GuiStracini.Mandae.Test -// Author : Guilherme Branco Stracini -// Created : 26/12/2022 -// -// Last Modified By : Guilherme Branco Stracini -// Last Modified On : 14/10/2023 -// *********************************************************************** -// -// Copyright © 2017 - 2023 -// -// -// *********************************************************************** +// // *********************************************************************** +// // Assembly : GuiStracini.Mandae.Test +// // Author : Guilherme Branco Stracini +// // Created : 26/12/2022 +// // +// // Last Modified By : Guilherme Branco Stracini +// // Last Modified On : 14/10/2023 +// // *********************************************************************** +// // +// // Copyright © 2017 - 2023 +// // +// // +// // *********************************************************************** -using Xunit; +// using Xunit; -namespace GuiStracini.Mandae.Tests.V2; +// namespace GuiStracini.Mandae.Tests.V2; -using System; -using System.Linq; -using Enums; -using Models; -using ValueObject; +// using System; +// using System.Linq; +// using Enums; +// using Models; +// using ValueObject; -/// -/// Flow test validation class performs a full flow validations. -/// Validates the vehicle, the rates, the available hours, register a order collect request and check the latest order status -/// -public class FlowTests -{ - /// - /// Full flow validation. - /// - [SkippableFact] - public void FullFlowValidation() - { - var client = new MandaeClient("0b5e2c6410cf0ac087ae7ace111dbd42"); - const string customerId = "182AC0ECDE0CA08A8B729733EBE8197D"; - var rnd = new Random(); - var ratesModel = new RatesModel - { - PostalCode = "22041080", - DeclaredValue = new decimal(215.15), - Dimensions = new Dimensions - { - Height = 60, - Length = 60, - Width = 40, - Weight = 1.3 - } - }; - var orderModel = new OrderModel - { - CustomerId = customerId, - Vehicle = Vehicle.CAR, - Observation = "Full flow validation test", - Scheduling = DateTime.Now, - PartnerOrderId = "1234567890", - Sender = new Sender - { - Address = new Address - { - Number = "527", - PostalCode = "03137020", - Neighborhood = "Vila Prudente", - City = "São Paulo", - State = "SP", - Street = "Rua Itanháem", - Country = "BR" - }, - FullName = "Editora Inovação" - }, - Items = new[] - { - new Item - { - Id = rnd.Next(10000, 99999), - Dimensions = ratesModel.Dimensions, - Observation = "Teste", - Recipient = new Recipient - { - Address = new Address - { - PostalCode = "22041080", - Number = "110", - Neighborhood = "Copacabana", - City = "Rio de Janeiro", - State = "RJ", - Street = "Rua Anita Garibaild", - Country = "BR" - }, - FullName = "Vitrine do Artesanato", - Email = "", - Phone = "+551133822031", - Document = "05944298000101" - }, - PartnerItemId = rnd.Next(1, 9999999).ToString(), - Invoice = new Invoice - { - Id = "606620", - Key = "35170805944298000101550010006066201623434877" - }, - Skus = new[] - { - new Sku - { - Description = "Caneta Acrilpen", - Ean = "7891153044392", - Price = new decimal(4.47), - Quantity = 2, - SkuId = "3583" - }, - new Sku - { - Description = "Tecido algodão crú sem risco", - Ean = string.Empty, - Price = new decimal(15.43), - Quantity = 2, - SkuId = "7522" - } - } - } - } - }; - var order = client.CreateOrderCollectRequest(orderModel); - Assert.Null(order.Error); - Assert.True(order.Id > 0); - Assert.True(order.Items.First().Id > 0); - } -} +// /// +// /// Flow test validation class performs a full flow validations. +// /// Validates the vehicle, the rates, the available hours, register a order collect request and check the latest order status +// /// +// public class FlowTests +// { +// /// +// /// Full flow validation. +// /// +// [SkippableFact] +// public void FullFlowValidation() +// { +// var client = new MandaeClient("0b5e2c6410cf0ac087ae7ace111dbd42"); +// const string customerId = "182AC0ECDE0CA08A8B729733EBE8197D"; +// var rnd = new Random(); +// var ratesModel = new RatesModel +// { +// PostalCode = "22041080", +// DeclaredValue = new decimal(215.15), +// Dimensions = new Dimensions +// { +// Height = 60, +// Length = 60, +// Width = 40, +// Weight = 1.3 +// } +// }; +// var orderModel = new OrderModel +// { +// CustomerId = customerId, +// Vehicle = Vehicle.CAR, +// Observation = "Full flow validation test", +// Scheduling = DateTime.Now, +// PartnerOrderId = "1234567890", +// Sender = new Sender +// { +// Address = new Address +// { +// Number = "527", +// PostalCode = "03137020", +// Neighborhood = "Vila Prudente", +// City = "São Paulo", +// State = "SP", +// Street = "Rua Itanháem", +// Country = "BR" +// }, +// FullName = "Editora Inovação" +// }, +// Items = new[] +// { +// new Item +// { +// Id = rnd.Next(10000, 99999), +// Dimensions = ratesModel.Dimensions, +// Observation = "Teste", +// Recipient = new Recipient +// { +// Address = new Address +// { +// PostalCode = "22041080", +// Number = "110", +// Neighborhood = "Copacabana", +// City = "Rio de Janeiro", +// State = "RJ", +// Street = "Rua Anita Garibaild", +// Country = "BR" +// }, +// FullName = "Vitrine do Artesanato", +// Email = "", +// Phone = "+551133822031", +// Document = "05944298000101" +// }, +// PartnerItemId = rnd.Next(1, 9999999).ToString(), +// Invoice = new Invoice +// { +// Id = "606620", +// Key = "35170805944298000101550010006066201623434877" +// }, +// Skus = new[] +// { +// new Sku +// { +// Description = "Caneta Acrilpen", +// Ean = "7891153044392", +// Price = new decimal(4.47), +// Quantity = 2, +// SkuId = "3583" +// }, +// new Sku +// { +// Description = "Tecido algodão crú sem risco", +// Ean = string.Empty, +// Price = new decimal(15.43), +// Quantity = 2, +// SkuId = "7522" +// } +// } +// } +// } +// }; +// var order = client.CreateOrderCollectRequest(orderModel); +// Assert.Null(order.Error); +// Assert.True(order.Id > 0); +// Assert.True(order.Items.First().Id > 0); +// } +// } diff --git a/Tests/GuiStracini.Mandae.Tests/V2/OrdersTests.cs b/Tests/GuiStracini.Mandae.Tests/V2/OrdersTests.cs index 9c87840..8b94eb8 100644 --- a/Tests/GuiStracini.Mandae.Tests/V2/OrdersTests.cs +++ b/Tests/GuiStracini.Mandae.Tests/V2/OrdersTests.cs @@ -1,55 +1,55 @@ -// *********************************************************************** -// Assembly : GuiStracini.Mandae -// Author : Guilherme Branco Stracini -// Created : 28/09/2017 -// -// Last Modified By : Guilherme Branco Stracini -// Last Modified On : 14/10/2023 -// *********************************************************************** -// -// Copyright © 2017-2023 Guilherme Branco Stracini -// -// -// *********************************************************************** +// // *********************************************************************** +// // Assembly : GuiStracini.Mandae +// // Author : Guilherme Branco Stracini +// // Created : 28/09/2017 +// // +// // Last Modified By : Guilherme Branco Stracini +// // Last Modified On : 14/10/2023 +// // *********************************************************************** +// // +// // Copyright © 2017-2023 Guilherme Branco Stracini +// // +// // +// // *********************************************************************** -using Xunit; +// using Xunit; -namespace GuiStracini.Mandae.Tests.V2; +// namespace GuiStracini.Mandae.Tests.V2; -using System.Threading; -using System.Threading.Tasks; +// using System.Threading; +// using System.Threading.Tasks; -/// -/// The orders test class -/// -public class OrdersTests -{ - /// - /// Validates register order collect request method. - /// - [SkippableFact] - public void RegisterOrderCollectRequest() - { - var client = new MandaeClient("0b5e2c6410cf0ac087ae7ace111dbd42"); - var orderModel = MockOrdersRepository.GetSampleOrderModel(); - var order = client.CreateOrderCollectRequest(orderModel); - Assert.Null(order.Error); - Assert.True(order.Id > 0); - Assert.True(order.Items[0].Id > 0); - } +// /// +// /// The orders test class +// /// +// public class OrdersTests +// { +// /// +// /// Validates register order collect request method. +// /// +// [SkippableFact] +// public void RegisterOrderCollectRequest() +// { +// var client = new MandaeClient("0b5e2c6410cf0ac087ae7ace111dbd42"); +// var orderModel = MockOrdersRepository.GetSampleOrderModel(); +// var order = client.CreateOrderCollectRequest(orderModel); +// Assert.Null(order.Error); +// Assert.True(order.Id > 0); +// Assert.True(order.Items[0].Id > 0); +// } - /// - /// Validates register order collect request asynchronous method. - /// - /// A Task representing the asynchronous operation. - [SkippableFact] - public async Task RegisterOrderCollectRequestAsync() - { - var client = new MandaeClient("0b5e2c6410cf0ac087ae7ace111dbd42"); - var orderModel = MockOrdersRepository.GetSampleOrderModel(); - var order = await client.CreateOrderCollectRequestAsync(orderModel, CancellationToken.None); - Assert.Null(order.Error); - Assert.True(order.Id > 0); - Assert.True(order.Items[0].Id > 0); - } -} +// /// +// /// Validates register order collect request asynchronous method. +// /// +// /// A Task representing the asynchronous operation. +// [SkippableFact] +// public async Task RegisterOrderCollectRequestAsync() +// { +// var client = new MandaeClient("0b5e2c6410cf0ac087ae7ace111dbd42"); +// var orderModel = MockOrdersRepository.GetSampleOrderModel(); +// var order = await client.CreateOrderCollectRequestAsync(orderModel, CancellationToken.None); +// Assert.Null(order.Error); +// Assert.True(order.Id > 0); +// Assert.True(order.Items[0].Id > 0); +// } +// } diff --git a/Tests/GuiStracini.Mandae.Tests/V2/TrackingTests.cs b/Tests/GuiStracini.Mandae.Tests/V2/TrackingTests.cs index 7737719..d1df342 100644 --- a/Tests/GuiStracini.Mandae.Tests/V2/TrackingTests.cs +++ b/Tests/GuiStracini.Mandae.Tests/V2/TrackingTests.cs @@ -1,89 +1,89 @@ -// *********************************************************************** -// Assembly : GuiStracini.Mandae -// Author : Guilherme Branco Stracini -// Created : 28/09/2017 -// -// Last Modified By : Guilherme Branco Stracini -// Last Modified On : 14/10/2023 -// *********************************************************************** -// -// Copyright © 2017-2023 Guilherme Branco Stracini -// -// -// *********************************************************************** +// // *********************************************************************** +// // Assembly : GuiStracini.Mandae +// // Author : Guilherme Branco Stracini +// // Created : 28/09/2017 +// // +// // Last Modified By : Guilherme Branco Stracini +// // Last Modified On : 14/10/2023 +// // *********************************************************************** +// // +// // Copyright © 2017-2023 Guilherme Branco Stracini +// // +// // +// // *********************************************************************** -using Xunit; +// using Xunit; -namespace GuiStracini.Mandae.Tests.V2; +// namespace GuiStracini.Mandae.Tests.V2; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Transport; +// using System.Linq; +// using System.Threading; +// using System.Threading.Tasks; +// using Transport; -/// -/// The tracking test class -/// -public class TrackingTests -{ - /// - /// Validates the get tracking method. - /// - [SkippableFact] - public void GetTracking() - { - var client = new MandaeClient("0b5e2c6410cf0ac087ae7ace111dbd42"); - var orderModel = MockOrdersRepository.GetSampleOrderModel(); - var order = client.CreateOrderCollectRequest(orderModel); - var trackingId = AssertOrderResult(order); - var tracking = client.GetTracking(trackingId); - AssertTrackingResult(tracking, trackingId); - } +// /// +// /// The tracking test class +// /// +// public class TrackingTests +// { +// /// +// /// Validates the get tracking method. +// /// +// [SkippableFact] +// public void GetTracking() +// { +// var client = new MandaeClient("0b5e2c6410cf0ac087ae7ace111dbd42"); +// var orderModel = MockOrdersRepository.GetSampleOrderModel(); +// var order = client.CreateOrderCollectRequest(orderModel); +// var trackingId = AssertOrderResult(order); +// var tracking = client.GetTracking(trackingId); +// AssertTrackingResult(tracking, trackingId); +// } - /// - /// Validates the get tracking asynchronous method. - /// - /// A Task representing the asynchronous operation. - [SkippableFact] - public async Task GetTrackingAsync() - { - await Task.Delay(500); - var client = new MandaeClient("0b5e2c6410cf0ac087ae7ace111dbd42"); - var orderModel = MockOrdersRepository.GetSampleOrderModel(); - var order = await client.CreateOrderCollectRequestAsync(orderModel, CancellationToken.None); - var trackingId = AssertOrderResult(order); - var tracking = await client.GetTrackingAsync(trackingId, CancellationToken.None); - AssertTrackingResult(tracking, trackingId); - } +// /// +// /// Validates the get tracking asynchronous method. +// /// +// /// A Task representing the asynchronous operation. +// [SkippableFact] +// public async Task GetTrackingAsync() +// { +// await Task.Delay(500); +// var client = new MandaeClient("0b5e2c6410cf0ac087ae7ace111dbd42"); +// var orderModel = MockOrdersRepository.GetSampleOrderModel(); +// var order = await client.CreateOrderCollectRequestAsync(orderModel, CancellationToken.None); +// var trackingId = AssertOrderResult(order); +// var tracking = await client.GetTrackingAsync(trackingId, CancellationToken.None); +// AssertTrackingResult(tracking, trackingId); +// } - /// - /// Asserts the order result. - /// - /// The order. - /// System.String. - private static string AssertOrderResult(OrderResponse order) - { - Assert.Null(order.Error); - Assert.True(order.Id > 0); - var item = order.Items.FirstOrDefault(); - Skip.If(item == null); - Assert.True(item.Id > 0); - var trackingId = item.TrackingId; - Skip.If(trackingId == null); - return trackingId; - } +// /// +// /// Asserts the order result. +// /// +// /// The order. +// /// System.String. +// private static string AssertOrderResult(OrderResponse order) +// { +// Assert.Null(order.Error); +// Assert.True(order.Id > 0); +// var item = order.Items.FirstOrDefault(); +// Skip.If(item == null); +// Assert.True(item.Id > 0); +// var trackingId = item.TrackingId; +// Skip.If(trackingId == null); +// return trackingId; +// } - /// - /// Asserts the tracking result. - /// - /// The tracking. - /// The tracking identifier. - private static void AssertTrackingResult(TrackingResponse tracking, string trackingId) - { - Assert.Null(tracking.Error); - Assert.Equal(trackingId, tracking.TrackingCode); - Assert.Null(tracking.CarrierName); - Assert.Null(tracking.CarrierCode); - Assert.False(tracking.Events.Any()); - } -} +// /// +// /// Asserts the tracking result. +// /// +// /// The tracking. +// /// The tracking identifier. +// private static void AssertTrackingResult(TrackingResponse tracking, string trackingId) +// { +// Assert.Null(tracking.Error); +// Assert.Equal(trackingId, tracking.TrackingCode); +// Assert.Null(tracking.CarrierName); +// Assert.Null(tracking.CarrierCode); +// Assert.False(tracking.Events.Any()); +// } +// } From ed6b7504f7151c24b9792b8da1b37caadc0c9c23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 18:03:49 +0100 Subject: [PATCH 2/2] Bump GuiStracini.SDKBuilder from 3.0.551 to 3.0.570 (#193) Bumps GuiStracini.SDKBuilder from 3.0.551 to 3.0.570. --- updated-dependencies: - dependency-name: GuiStracini.SDKBuilder dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Src/GuiStracini.Mandae/GuiStracini.Mandae.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/GuiStracini.Mandae/GuiStracini.Mandae.csproj b/Src/GuiStracini.Mandae/GuiStracini.Mandae.csproj index 7a8daac..49316cd 100644 --- a/Src/GuiStracini.Mandae/GuiStracini.Mandae.csproj +++ b/Src/GuiStracini.Mandae/GuiStracini.Mandae.csproj @@ -27,7 +27,7 @@ - +