HouseOver.THARM.UnitTest.RealtyManagerTest Class Reference

This class is a unit test class for the RealtyManager class. It uses black box testing to test the primary functionality of the class. More...

Collaboration diagram for HouseOver.THARM.UnitTest.RealtyManagerTest:

Collaboration graph
[legend]
List of all members.

Public Member Functions

[SetUp] void Init ()
 Set up the data by creating a customer and adding a few sales.
[Test] void TestProfileMatch ()
 Test if the GetAllSalesWithinMaxPrice() method works.
[SetUp] void Init ()
 Set up the data by creating a customer and adding a few sales.
[Test] void TestProfileMatch ()
 Test if the GetAllSalesWithinMaxPrice() method works.

Private Attributes

CatalogueData data
RealtyManager rm
Customer c

Detailed Description

This class is a unit test class for the RealtyManager class. It uses black box testing to test the primary functionality of the class.

Definition at line 14 of file RealtyManagerTest.cs.


Member Function Documentation

[SetUp] void HouseOver.THARM.UnitTest.RealtyManagerTest.Init (  ) 

Set up the data by creating a customer and adding a few sales.

Definition at line 25 of file RealtyManagerTest.cs.

00026         {
00027             data = new CatalogueData();
00028             rm = new RealtyManager(data);
00029             
00030             c = new Customer(1000, "Some name");
00031 
00032             data.Add(c);
00033 
00034             data.Add(new Sale(30000, DateTime.Now, new House(10, 1200, 50, 1980, 3, 100), c));
00035             data.Add(new Sale(40000, DateTime.Now, new Apartment(12, 1300, 60, 1975, 2, 5), c));
00036             data.Add(new Sale(30000, DateTime.Now, new Domicile(14, 1200, 55, 1960, 2), c));
00037         }

[Test] void HouseOver.THARM.UnitTest.RealtyManagerTest.TestProfileMatch (  ) 

Test if the GetAllSalesWithinMaxPrice() method works.

Definition at line 43 of file RealtyManagerTest.cs.

00044         {
00045             Profile p = new Profile(c, 35000, typeof(House)); 
00046 
00047             data.Add(p);
00048 
00049             List<Sale> sales = rm.GetAllSalesWithinMaxPrice(30000);
00050             List<Sale> potential = rm.FindPotentialItems(p);
00051 
00052             Assert.AreEqual(sales.Count, 2);
00053             Assert.AreEqual(potential.Count, 1);
00054         }

[SetUp] void HouseOver.THARM.UnitTest.RealtyManagerTest.Init (  ) 

Set up the data by creating a customer and adding a few sales.

Definition at line 25 of file RealtyManagerTest.cs.

00026         {
00027             data = new CatalogueData();
00028             rm = new RealtyManager(data);
00029             
00030             c = new Customer(1000, "Some name");
00031 
00032             data.Add(c);
00033 
00034             data.Add(new Sale(30000, DateTime.Now, new House(10, 1200, 50, 1980, 3, 100), c));
00035             data.Add(new Sale(40000, DateTime.Now, new Apartment(12, 1300, 60, 1975, 2, 5), c));
00036             data.Add(new Sale(30000, DateTime.Now, new Domicile(14, 1200, 55, 1960, 2), c));
00037         }

[Test] void HouseOver.THARM.UnitTest.RealtyManagerTest.TestProfileMatch (  ) 

Test if the GetAllSalesWithinMaxPrice() method works.

Definition at line 43 of file RealtyManagerTest.cs.

00044         {
00045             Profile p = new Profile(c, 35000, typeof(House)); 
00046 
00047             data.Add(p);
00048 
00049             List<Sale> sales = rm.GetAllSalesWithinMaxPrice(30000);
00050             List<Sale> potential = rm.FindPotentialItems(p);
00051 
00052             Assert.AreEqual(sales.Count, 2);
00053             Assert.AreEqual(potential.Count, 1);
00054         }


Member Data Documentation

CatalogueData HouseOver::THARM::UnitTest.RealtyManagerTest::data [private]

Definition at line 16 of file RealtyManagerTest.cs.

RealtyManager HouseOver::THARM::UnitTest.RealtyManagerTest::rm [private]

Definition at line 17 of file RealtyManagerTest.cs.

Customer HouseOver::THARM::UnitTest.RealtyManagerTest::c [private]

Definition at line 19 of file RealtyManagerTest.cs.


The documentation for this class was generated from the following files:
Generated on Wed Jan 10 03:43:25 2007 for THARM by  doxygen 1.5.1-p1