public void GetTrailsByParkName() { using (TransactionScope transaction = new TransactionScope()) { int newParkId = ParkSqlDALTests.InsertFakePark(park); int newTrailId = TrailSqlDALTests.InsertFakeTrail(trail, newParkId); TrailSqlDAL testClass = new TrailSqlDAL(connectionString); List <TrailModel> newTrails = testClass.GetTrailsByParkName(park.Name); Assert.IsTrue(newTrails.Select(trail => trail.TrailId).Contains(newTrailId)); } }
public void GetTrailByTrailName() { using (TransactionScope transaction = new TransactionScope()) { int newParkId = ParkSqlDALTests.InsertFakePark(park); int newTrailId = TrailSqlDALTests.InsertFakeTrail(trail, newParkId); TrailSqlDAL testClass = new TrailSqlDAL(connectionString); TrailModel newTrail = testClass.GetTrailByTrailName(trail.Name); Assert.AreEqual(newTrail.TrailId, newTrailId); } }
public void GetPanoramicById() { using (TransactionScope transaction = new TransactionScope()) { int newParkId = ParkSqlDALTests.InsertFakePark(park); int newTrailId = TrailSqlDALTests.InsertFakeTrail(trail, newParkId); int newPanoramicId = PanoramicSqlDALTests.InsertFakePanoramic(panoramicImage, newTrailId); PanoramicSqlDAL testClass = new PanoramicSqlDAL(connectionString); PanoramicModel newPanoramicImages = testClass.GetPanoramicById(newPanoramicId); Assert.AreEqual(newPanoramicImages.PanoramicId, newPanoramicId); } }
public void GetImagesByTrailId() { using (TransactionScope transaction = new TransactionScope()) { int newParkId = ParkSqlDALTests.InsertFakePark(park); int newTrailId = TrailSqlDALTests.InsertFakeTrail(trail, newParkId); int newTrailImageId = TrailSqlDALTests.InsertFakeTrailImage(trailImage, newTrailId); TrailSqlDAL testClass = new TrailSqlDAL(connectionString); string newTrailImageAddress = testClass.GetImageByTrailId(newTrailId); Assert.AreEqual(trailImage.ImageAddress, newTrailImageAddress); } }
public void GetAllPanoramics() { using (TransactionScope transaction = new TransactionScope()) { int newParkId = ParkSqlDALTests.InsertFakePark(park); int newTrailId = TrailSqlDALTests.InsertFakeTrail(trail, newParkId); int newPanoramicId = PanoramicSqlDALTests.InsertFakePanoramic(panoramicImage, newTrailId); PanoramicSqlDAL testClass = new PanoramicSqlDAL(connectionString); List <PanoramicModel> newPanoramicImages = testClass.GetAllPanoramics(); Assert.IsTrue(newPanoramicImages.Select(panoramic => panoramic.PanoramicId).Contains(newPanoramicId)); } }