Ejemplo n.º 1
0
        public void Deve_retornar_erro_quando_serial_number_nao_existir()
        {
            _updateEndpointCommand.SerialNumber = "2";
            var result = (GenericCommandResult)_endpointHandler.Handle(_updateEndpointCommand);

            Assert.AreEqual(result.Success, false);
        }
 public void Deve_interromper_o_registro_quando_o_serial_number_ja_estiver_em_uso()
 {
     _registerEndpointCommand.SerialNumber = "1";
     _endpointHandler.Handle(_registerEndpointCommand);
     Assert.AreEqual(_endpointHandler.Invalid, true);
 }
 public GenericCommandResult Put(
     [FromBody] UpdateEndpointCommand command,
     [FromServices] EndpointHandler handler)
 {
     return((GenericCommandResult)handler.Handle(command));
 }
 public GenericCommandResult Delete(
     string serialNumber,
     [FromServices] EndpointHandler handler)
 {
     return((GenericCommandResult)handler.Handle(new DeleteEndpointCommand(serialNumber)));
 }
 public GenericCommandResult Post(
     [FromBody] RegisterEndpointCommand command,
     [FromServices] EndpointHandler handler)
 {
     return((GenericCommandResult)handler.Handle(command));
 }