// baseballMasterTest.cc   P. Conrad for CISC220, 06J
// Class for Lahman Baseball Database (www.baseball1.com), version 5.3

// See license and copyright statement at bottom of file


#include <iostream>
using std::cout;
using std::cerr;
using std::endl;

#include "runTests.h"

#include "person.h"

int main(void)
{

  RunTests_C test;


  Person_C x("Phill","Conrad",123);

  test.assertEquals(x.getFname(),"Phill");
  test.assertEquals(x.getLname(),"Conrad");
  test.assertEquals(x.getId(),123);

  // now test the copy constructor and overloaded assignment operator

  Person_C y(x); // tests the copy constructor's copying
  test.assertEquals(y.getFname(),"Phill");
  test.assertEquals(y.getLname(),"Conrad");
  test.assertEquals(y.getId(),123);

  // now test the independence of x and y--i.e. make sure
  // we did a deep copy and not a shallow one

  y.setFname("Fred");
  y.setLname("Flintstone");
  y.setId(456);

  test.assertEquals(y.getFname(),"Fred");
  test.assertEquals(y.getLname(),"Flintstone");
  test.assertEquals(y.getId(),456);

  test.assertEquals(x.getFname(),"Phill");
  test.assertEquals(x.getLname(),"Conrad");
  test.assertEquals(x.getId(),123);

  Person_C z = x; // does it use copy constructor or overloaded =?

  test.assertEquals(z.getFname(),"Phill");
  test.assertEquals(z.getLname(),"Conrad");
  test.assertEquals(z.getId(),123);

  // continue with testing the overloaded = and the destructors

  test.print(cerr);
  test.finish();
}



// COPYRIGHT NOTICE:

// This code corresponds to the data layout of the Lahmann Database,
// which is copyrighted by Sean Lahmann.  The data and formats here
// are used by special permission of Sean Lahmann, granted to Phill 
// Conrad for use in Computer Science courses at the University of 
// Delaware.  You must obtain permission from Sean Lahmann to use this
// data and/or data format for any other purpose.  For more details,
// visit www.baseball1.com

