Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/nuget/xunit.runner.visualstudio-2…
Browse files Browse the repository at this point in the history
….8.2
  • Loading branch information
gstraccini[bot] authored Jul 16, 2024
2 parents f6fd6fe + ed6b750 commit 2366d5a
Show file tree
Hide file tree
Showing 5 changed files with 261 additions and 261 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deep-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: >-
Expand All @@ -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
./bin/deepsource report --analyzer test-coverage --key csharp --value-file ./Tests/GuiStracini.Mandae.Tests/coverage.cobertura.xml
2 changes: 1 addition & 1 deletion Src/GuiStracini.Mandae/GuiStracini.Mandae.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GuiStracini.SDKBuilder" Version="3.0.551" />
<PackageReference Include="GuiStracini.SDKBuilder" Version="3.0.570" />
<!-- ReSharper disable once VulnerablePackage -->
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.27.0.93347">
Expand Down
252 changes: 126 additions & 126 deletions Tests/GuiStracini.Mandae.Tests/V2/FlowTests.cs
Original file line number Diff line number Diff line change
@@ -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 file="FlowTest.cs" company="Guilherme Branco Stracini ME">
// Copyright © 2017 - 2023
// </copyright>
// <summary></summary>
// ***********************************************************************
// // ***********************************************************************
// // 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 file="FlowTest.cs" company="Guilherme Branco Stracini ME">
// // Copyright © 2017 - 2023
// // </copyright>
// // <summary></summary>
// // ***********************************************************************

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;

/// <summary>
/// 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
/// </summary>
public class FlowTests
{
/// <summary>
/// Full flow validation.
/// </summary>
[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);
}
}
// /// <summary>
// /// 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
// /// </summary>
// public class FlowTests
// {
// /// <summary>
// /// Full flow validation.
// /// </summary>
// [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);
// }
// }
100 changes: 50 additions & 50 deletions Tests/GuiStracini.Mandae.Tests/V2/OrdersTests.cs
Original file line number Diff line number Diff line change
@@ -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 file="OrdersTest.cs" company="Guilherme Branco Stracini ME">
// Copyright © 2017-2023 Guilherme Branco Stracini
// </copyright>
// <summary></summary>
// ***********************************************************************
// // ***********************************************************************
// // Assembly : GuiStracini.Mandae
// // Author : Guilherme Branco Stracini
// // Created : 28/09/2017
// //
// // Last Modified By : Guilherme Branco Stracini
// // Last Modified On : 14/10/2023
// // ***********************************************************************
// // <copyright file="OrdersTest.cs" company="Guilherme Branco Stracini ME">
// // Copyright © 2017-2023 Guilherme Branco Stracini
// // </copyright>
// // <summary></summary>
// // ***********************************************************************

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;

/// <summary>
/// The orders test class
/// </summary>
public class OrdersTests
{
/// <summary>
/// Validates register order collect request method.
/// </summary>
[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);
}
// /// <summary>
// /// The orders test class
// /// </summary>
// public class OrdersTests
// {
// /// <summary>
// /// Validates register order collect request method.
// /// </summary>
// [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);
// }

/// <summary>
/// Validates register order collect request asynchronous method.
/// </summary>
/// <returns>A Task representing the asynchronous operation.</returns>
[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);
}
}
// /// <summary>
// /// Validates register order collect request asynchronous method.
// /// </summary>
// /// <returns>A Task representing the asynchronous operation.</returns>
// [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);
// }
// }
Loading

0 comments on commit 2366d5a

Please sign in to comment.