public Output execute() { try { inputDto.callValidations(); addValuesFromInputToAdapter(); invokeValidations(); Interactor fileVialReader = new FileVialReader(); return(fileVialReader.execute(inputAdapterDto)); } catch (Exception e) { return(prepareErrorResponse(e.Message)); } }
public OutputDto execute() { try { inputDto.callValidations(); addValuesFromInputToAdapter(); Shape shape = ModuleConfig.createShape(inputDto.ShapeName, inputAdapterDto.Values); inputAdapterDto.Shape = shape; Interactor shapeInteractor = new ShapeInteractor(); return(shapeInteractor.execute(inputAdapterDto)); } catch (Exception e) { return(prepareErrorResponse(e.Message)); } }
public void when_the_name_of_the_file_is_null_then_throw_exception() { InputDto input = new InputDto(null); input.callValidations(); }
public void when_input_is_correct_then_validations_run_successfully() { InputDto input = new InputDto("vial-test.csv"); input.callValidations(); }
public void when_values_are_not_separated_by_comma_then_throw_exception() { InputDto input = new InputDto("triangle", "area", "2:2;3"); input.callValidations(); }
public void when_operation_does_not_exist_then_throw_exception() { InputDto input = new InputDto("rectangle", "are", "2,2"); input.callValidations(); }
public void when_shape_does_not_exist_then_throw_exception() { InputDto input = new InputDto("squ", "perimeter", "2"); input.callValidations(); }
public void when_input_is_correct_then_validations_run_successfully() { InputDto input = new InputDto("triangle", "area", "2,2,2"); input.callValidations(); }