public void setIdTest() { Attendee a = new Attendee(); a.setId(99); Assert.AreEqual(99, a.getId()); }
public void loadedConstructorTest() { Attendee a = new Attendee(60, "Bob", "Jones", "The Great Company", "*****@*****.**", "(704)555-6789"); Assert.AreEqual(60, a.getId()); Assert.AreEqual("Bob", a.getFirstName()); Assert.AreEqual("Jones", a.getLastName()); Assert.AreEqual("The Great Company", a.getCompany()); Assert.AreEqual("*****@*****.**", a.getEmail()); Assert.AreEqual("(704)555-6789", a.getPhone()); }
public void constructorTest() { Attendee a = new Attendee(); Assert.AreEqual(0, a.getId()); Assert.AreEqual(null, a.getFirstName()); Assert.AreEqual(null, a.getLastName()); Assert.AreEqual(null, a.getCompany()); Assert.AreEqual(null, a.getEmail()); Assert.AreEqual(null, a.getPhone()); }
public void TestMethod1() { var e = new Attendee("参加者1"); Assert.AreEqual(e.getName(), "参加者1"); Assert.AreEqual(e.getId(), 0); var e2 = new Attendee("参加者2"); Assert.AreEqual(e2.getName(), "参加者2"); Assert.AreEqual(e2.getId(), 1); var e3 = e; Assert.AreEqual(e.equals(e3), true); Assert.AreEqual(e.equals(e2), false); }