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); }
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); }
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); }); }
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); }); }
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)); }
public void Agency_GetPotentialProfitAgency() { //arrange Agency agency = new Agency(InitializationApartments()); const double profit = 1481000; //act var profitResult = agency.GetPotentialProfitAgency(); //assert Assert.AreEqual(profitResult,profit); }