The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

SADI::Service::UnitTest - A module that encapsulates unit test information for sadi services.

SYNOPSIS

use SADI::Service::UnitTest;

# create a new blank SADI UnitTest object
my $data = SADI::Service::UnitTest->new ();

# create a new primed SADI UnitTest object
$data = SADI::Service::UnitTest->new (
    regex  => '(\w+)+',
    xpath  => '/xml/text()',
    input  => '<xml/>',
    output => '<xml/>',
);

# get the unit test regex
my $regex = $data->regex;
# set the regex statement for this test
$data->regex($regex);

# get the unit test xpath statement
my $xpath = $data->xpath;
# set the xpath statement for this test
$data->regex($xpath);

# get input for this test
my $input = $data->input;
# set the input for this test
$data->input($input);

# get expected output for this test
my $output = $data->output;
# set the expected output for this test
$data->output($output);

DESCRIPTION

An object representing a SADI service unit test.

AUTHORS

Edward Kawas (edward.kawas [at] gmail [dot] com)

ACCESSIBLE ATTRIBUTES

Details are in SADI::Base. Here just a list of them (additionally to the attributes from the parent classes)

input

The input for this unit test. Input is required, because without it, there can be no test

output

The expected output of this service given the specified input.

regex

A regular expression that should match the output of the service given the specified input.

xpath

An xpath expression that should yield return results given the specified input.