-
Notifications
You must be signed in to change notification settings - Fork 484
/
Copy pathExtinfNFeSuplTestes.cs
47 lines (41 loc) · 1.52 KB
/
ExtinfNFeSuplTestes.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Linq;
using DFe.Classes.Entidades;
using DFe.Classes.Flags;
using NFe.Classes;
using NFe.Utils.InformacoesSuplementares;
using Xunit;
namespace NFe.Utils.Testes
{
public class ExtinfNFeSuplTestes
{
[Theory]
[ClassData(typeof(EstadosAmbientesData))]
public void UrlQrCode2DeveTerminarComQueryPararametro(Estado estado, TipoAmbiente tipoAmbiente)
{
var infNFeSupl = new infNFeSupl();
var url = infNFeSupl.ObterUrlQrCode2ComParametro(tipoAmbiente, estado, VersaoServico.Versao400);
Assert.EndsWith("?p=", url);
}
}
public class EstadosAmbientesData : TheoryData<Estado, TipoAmbiente>
{
public EstadosAmbientesData()
{
var todosOsEstados = Enum.GetValues(typeof(Estado)).Cast<Estado>().ToList();
todosOsEstados.Remove(Estado.AN);
todosOsEstados.Remove(Estado.EX);
// UF autorizadora
todosOsEstados.Remove(Estado.SVRS);
//Não divulgaram as urls para homologação e produção no ENCAT
todosOsEstados.Remove(Estado.CE);
todosOsEstados.Remove(Estado.ES);
todosOsEstados.Remove(Estado.SC);
todosOsEstados.Remove(Estado.MG);
var tiposAmbiente = Enum.GetValues(typeof(TipoAmbiente)).Cast<TipoAmbiente>().ToList();
foreach (var estado in todosOsEstados)
foreach (var tipoAmbiente in tiposAmbiente)
Add(estado, tipoAmbiente);
}
}
}