-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/nuget/xunit.runner.visualstudio-2…
….8.2
- Loading branch information
Showing
5 changed files
with
261 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
// } | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
// } | ||
// } |
Oops, something went wrong.