-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REINF: Testes de desserialização do evento de retorno da série R-4000…
… (R-9005).
- Loading branch information
Henrique Clausing
committed
Sep 12, 2023
1 parent
fae19cb
commit 9b95183
Showing
5 changed files
with
168 additions
and
2 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
22 changes: 22 additions & 0 deletions
22
src/Tests/EficazFramework.Tests/Resources/Schemas/EFD-Reinf.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
56 changes: 56 additions & 0 deletions
56
src/Tests/EficazFramework.Tests/Schemas/EFD-Reinf/R-9005.cs
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System.Linq.Expressions; | ||
|
||
namespace EficazFramework.SPED.Schemas.EFD_Reinf; | ||
|
||
public class R9005Test | ||
{ | ||
[Test] | ||
[TestCase(Versao.v2_01_02)] | ||
public void ValidaRetornoEnvio(Versao versao) | ||
{ | ||
R9005 instancia = new() | ||
{ | ||
Versao = versao | ||
}; | ||
instancia = (R9005)instancia.Read(Resources.Schemas.EFD_Reinf.Content_R9005_v2_01_02_B); | ||
instancia.evtRet.id.Should().Be("ID9005000000000000000000000601050088"); | ||
instancia.evtRet.ideEvento.perApur.Should().Be("2023-08"); | ||
instancia.evtRet.ideContri.tpInsc.Should().Be(PersonalidadeJuridica.CNPJ); | ||
instancia.evtRet.ideContri.nrInsc.Should().Be("34785515"); | ||
instancia.evtRet.ideRecRetorno.ideStatus.cdRetorno.Should().Be("0"); | ||
instancia.evtRet.ideRecRetorno.ideStatus.descRetorno.Should().Be("SUCESSO"); | ||
instancia.evtRet.infoRecEv.nrRecArqBase.Should().Be("26072-02-4020-2308-26072"); | ||
instancia.evtRet.infoRecEv.nrProtLote.Should().Be("2.202309.1247674"); | ||
instancia.evtRet.infoRecEv.dhRecepcao.Date.Should().Be(new DateTime(2023, 09, 11)); | ||
instancia.evtRet.infoRecEv.dhRecepcao.Hour.Should().Be(21); | ||
instancia.evtRet.infoRecEv.dhRecepcao.Minute.Should().Be(43); | ||
instancia.evtRet.infoRecEv.dhRecepcao.Second.Should().Be(41); | ||
instancia.evtRet.infoRecEv.dhProcess.Date.Should().Be(new DateTime(2023, 09, 11)); | ||
instancia.evtRet.infoRecEv.dhProcess.Hour.Should().Be(21); | ||
instancia.evtRet.infoRecEv.dhProcess.Minute.Should().Be(43); | ||
instancia.evtRet.infoRecEv.dhProcess.Second.Should().Be(42); | ||
instancia.evtRet.infoRecEv.tpEv.Should().Be("4020"); | ||
instancia.evtRet.infoRecEv.idEv.Should().Be("ID1000000112116922023091121434100001"); | ||
instancia.evtRet.infoRecEv.hash.Should().Be("NBZkwxhz0EL9Uxq0UQxgz/BJZF72DtqKkYB4az7Bqf0="); | ||
instancia.evtRet.infoRecEv.fechRet.Should().BeNull(); | ||
|
||
instancia.evtRet.infoTotal.ideEstab.tpInsc.Should().Be(PersonalidadeJuridica.CNPJ); | ||
instancia.evtRet.infoTotal.ideEstab.nrInsc.Should().Be("61918769000188"); | ||
instancia.evtRet.infoTotal.ideEstab.nrInscBenef.Should().Be("10608025000126"); | ||
instancia.evtRet.infoTotal.ideEstab.TotalApuracaoQuinzenal.Should().BeNull(); | ||
instancia.evtRet.infoTotal.ideEstab.TotalApuracaoDecendial.Should().BeNull(); | ||
instancia.evtRet.infoTotal.ideEstab.TotalApuracaoSemanal.Should().BeNull(); | ||
instancia.evtRet.infoTotal.ideEstab.TotalApuracaoDiaria.Should().BeNull(); | ||
var totalMesNR = instancia.evtRet.infoTotal.ideEstab.TotalApuracaoMensal; | ||
totalMesNR.Should().NotBeNull(); | ||
totalMesNR.Where(e => e.CodigoReceita == "170806") | ||
.Sum(e => decimal.Parse(e.ValorBaseCR ?? "0")) | ||
.Should().Be(152725.25M); | ||
totalMesNR.Where(e => e.CodigoReceita == "170806") | ||
.Sum(e => decimal.Parse(e.TotalApuracaoTributo.ValorCRInformado ?? "0")) | ||
.Should().Be(2290.88M); | ||
totalMesNR.Sum(e => decimal.Parse(e.ValorBaseCR ?? "0")).Should().Be(610901M); | ||
totalMesNR.Sum(e => decimal.Parse(e.TotalApuracaoTributo.ValorCRInformado ?? "0")).Should().Be(23137.88M); | ||
} | ||
|
||
} |