コード例 #1
0
void TCustomer::testGroupId () {
    Customer c;

    c.setGroupId (tGroup);

    QVERIFY (c.getGroupId () == tGroup);
}
コード例 #2
0
void MainWindow::on_FindCustomer_clicked()
{
    if("" == ui->FindID->text())
    {
        QMessageBox::about(0,Title,NoCustomerID);
        ui->FindID->setFocus();
    }
    else
    {
        Customer customer;

        customer = CM.fetchCustomer(ui->FindID->text());
        if(customer.getName()!="")
        {
            ui->FindName->setText(customer.getName());
            ui->FindSurname->setText(customer.getSurname());
            ui->FindGroupID->setText(QString("%1").arg(customer.getGroupId()));
         }
        else
        {
          QMessageBox::about(0,Title,NoCustomerID);
        }
        ui->FindName->setFocus();
    }

}
コード例 #3
0
void TCustomer::testConstructor () {
    Customer c (tId, tName, tSurname, tGroup);

    QVERIFY (c.getId ()      == tId      &&
             c.getName ()    == tName    &&
             c.getSurname () == tSurname &&
             c.getGroupId () == tGroup);
}