Spaces:
Runtime error
Runtime error
Download tests/SCM.UnitTests/Controle/ExecutorTests.cs from rafaeldavila/scm-api: direct link, hf CLI and curl.
- Browser
- Download file 1.27 kB
-
https://huggingface.co/spaces/rafaeldavila/scm-api/resolve/main/tests/SCM.UnitTests/Controle/ExecutorTests.cs
- Command line
-
hf download hf://spaces/rafaeldavila/scm-api/tests/SCM.UnitTests/Controle/ExecutorTests.cs
-
curl -L -o ExecutorTests.cs https://huggingface.co/spaces/rafaeldavila/scm-api/resolve/main/tests/SCM.UnitTests/Controle/ExecutorTests.cs
1.27 kB
| using FluentAssertions; | |
| using SCM.Domain.Controle; | |
| using SCM.Shared.Exceptions; | |
| using Xunit; | |
| namespace SCM.UnitTests.Controle; | |
| public class ExecutorTests | |
| { | |
| private static readonly Guid Obra = Guid.NewGuid(); | |
| [] | |
| public void Create_DeveTrimarCampos() | |
| { | |
| var e = Executor.Create(Obra, " EX-01 ", " Empreiteira A "); | |
| e.ObraId.Should().Be(Obra); | |
| e.Codigo.Should().Be("EX-01"); | |
| e.Descricao.Should().Be("Empreiteira A"); | |
| } | |
| [] | |
| public void Create_DeveLancarDomainException_QuandoObraVazia() | |
| { | |
| var act = () => Executor.Create(Guid.Empty, "EX-01", "Empreiteira"); | |
| act.Should().Throw<DomainException>().WithMessage("*obra*"); | |
| } | |
| [] | |
| [] | |
| [] | |
| public void Create_DeveLancarDomainException_QuandoObrigatorioVazio(string codigo, string descricao) | |
| { | |
| var act = () => Executor.Create(Obra, codigo, descricao); | |
| act.Should().Throw<DomainException>(); | |
| } | |
| [] | |
| public void Atualizar_DeveTrocarCampos() | |
| { | |
| var e = Executor.Create(Obra, "EX-01", "Antiga"); | |
| e.Atualizar("EX-02", "Nova"); | |
| e.Codigo.Should().Be("EX-02"); | |
| e.Descricao.Should().Be("Nova"); | |
| } | |
| } | |