コード例 #1
0
 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));
     }
 }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
 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);
     }
 }
コード例 #4
0
 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);
     }
 }
コード例 #5
0
 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));
     }
 }