Spaces:
Runtime error
Runtime error
Download tests/SCM.UnitTests/Controle/ItemProgramadoTests.cs from rafaeldavila/scm-api: direct link, hf CLI and curl.
- Browser
- Download file 1.86 kB
-
https://huggingface.co/spaces/rafaeldavila/scm-api/resolve/main/tests/SCM.UnitTests/Controle/ItemProgramadoTests.cs
- Command line
-
hf download hf://spaces/rafaeldavila/scm-api/tests/SCM.UnitTests/Controle/ItemProgramadoTests.cs
-
curl -L -o ItemProgramadoTests.cs https://huggingface.co/spaces/rafaeldavila/scm-api/resolve/main/tests/SCM.UnitTests/Controle/ItemProgramadoTests.cs
1.86 kB
| using FluentAssertions; | |
| using SCM.Domain.Controle; | |
| using SCM.Shared.Exceptions; | |
| using Xunit; | |
| namespace SCM.UnitTests.Controle; | |
| public class ItemProgramadoTests | |
| { | |
| private static readonly Guid Ic = Guid.NewGuid(); | |
| [] | |
| public void Create_DeveTrimarDescricao_E_GuardarValores() | |
| { | |
| var data = new DateOnly(2026, 7, 1); | |
| var i = ItemProgramado.Create(Ic, " Concretagem ", 12.5m, data); | |
| i.ItemControleId.Should().Be(Ic); | |
| i.Descricao.Should().Be("Concretagem"); | |
| i.Quantidade.Should().Be(12.5m); | |
| i.DataProgramada.Should().Be(data); | |
| } | |
| [] | |
| public void Create_DevePermitirDataNula() | |
| { | |
| var i = ItemProgramado.Create(Ic, "Montagem", 1m, null); | |
| i.DataProgramada.Should().BeNull(); | |
| } | |
| [] | |
| public void Create_DeveLancarDomainException_QuandoIcVazio() | |
| { | |
| var act = () => ItemProgramado.Create(Guid.Empty, "Montagem", 1m, null); | |
| act.Should().Throw<DomainException>().WithMessage("*item de controle*"); | |
| } | |
| [] | |
| public void Create_DeveLancarDomainException_QuandoDescricaoVazia() | |
| { | |
| var act = () => ItemProgramado.Create(Ic, " ", 1m, null); | |
| act.Should().Throw<DomainException>().WithMessage("*descrição*"); | |
| } | |
| [] | |
| public void Create_DeveLancarDomainException_QuandoQuantidadeNegativa() | |
| { | |
| var act = () => ItemProgramado.Create(Ic, "Montagem", -1m, null); | |
| act.Should().Throw<DomainException>().WithMessage("*quantidade*"); | |
| } | |
| [] | |
| public void Atualizar_DeveTrocarCampos() | |
| { | |
| var i = ItemProgramado.Create(Ic, "Antiga", 1m, null); | |
| var data = new DateOnly(2026, 8, 15); | |
| i.Atualizar("Nova", 9m, data); | |
| i.Descricao.Should().Be("Nova"); | |
| i.Quantidade.Should().Be(9m); | |
| i.DataProgramada.Should().Be(data); | |
| } | |
| } | |