Example #1
0
 public void Agency_GetApartmentsForSale()
 {
     //arrange
     Agency agency = new Agency(InitializationApartments());
     const int result = 6;
     //act
     var apartmentsForSale = agency.GetApartmentsForSale();
     //assert
     Assert.AreEqual(apartmentsForSale.Count,result);
 }
Example #2
0
 public void Agency_GetApartmentById()
 {
     //arrange
     Agency agency = new Agency(InitializationApartments());
     const int apartmentId = 7;
     //act
     var apartmet = agency.GetApartmentById(apartmentId);
     //assert
     Assert.AreEqual(apartmet.Id,apartmentId);
 }
Example #3
0
 public void Agency_GetApartmentsByCountRoom()
 {
     //arrange
     Agency agency = new Agency(InitializationApartments());
     const int countRooms = 2;
     //act
     var apartmentsWithRooms = agency.GetApartmentsByCountRoom(countRooms);
     //assert
     apartmentsWithRooms.ForEach(item =>
     {
         Assert.AreEqual(item.CountRooms, countRooms);
     });
 }
Example #4
0
 public void Agency_GetApartmentsByFootage()
 {
     //arrange
     Agency agency = new Agency(InitializationApartments());
     const double fFrom = 20.0;
     const double fTo = 30.0;
     //act
     var apartmentByFootage = agency.GetApartmentsByFootage(fFrom, fTo);
     //assert
     apartmentByFootage.ForEach(item =>
     {
         Assert.IsTrue(item.Footage >= fFrom);
         Assert.IsTrue(item.Footage <= fTo);
     });
 }
Example #5
0
 public void Agency_GetApartmentsForRent()
 {
     //arrange
     Agency agency = new Agency(InitializationApartments());
     const int result = 6;
     //act
     var apartmentsForSale = agency.GetApartmentsForRent();
     var expApt =
         InitializationApartments()
             .Where(item => item is ApartmentForSale)
             .ToList()
             .OrderBy(p => p.Cost/p.Footage)
             .ToList();
     //assert
     CollectionAssert.AreEqual(expApt.ToList(),apartmentsForSale.ToList());
     //Assert.IsTrue(expApt.SequenceEqual(apartmentsForSale));
 }
Example #6
0
 public void Agency_GetPotentialProfitAgency()
 {
     //arrange
     Agency agency = new Agency(InitializationApartments());
     const double profit = 1481000;
     //act
     var profitResult = agency.GetPotentialProfitAgency();
     //assert
     Assert.AreEqual(profitResult,profit);
 }