本文整理汇总了C#中Place.CreateAndFlush方法的典型用法代码示例。如果您正苦于以下问题:C# Place.CreateAndFlush方法的具体用法?C# Place.CreateAndFlush怎么用?C# Place.CreateAndFlush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Place
的用法示例。
在下文中一共展示了Place.CreateAndFlush方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Setup
public override void Setup()
{
base.Setup();
mocks = new MockRepository();
// save one entry in the database that has a place and a watershed attached
ClosestWatershedToPlace closestWatershedToPlace = new ClosestWatershedToPlace();
Place testPlace = new Place();
testPlace.CgndbKey = "ABCDE";
testPlace.CreateAndFlush();
Watershed testWatershed = new Watershed();
testWatershed.DrainageCode = "01-00-00-00-00-00";
testWatershed.Place = testPlace;
testWatershed.CreateAndFlush();
closestWatershedToPlace.Place = testPlace;
closestWatershedToPlace.Watershed = testWatershed;
closestWatershedToPlace.CreateAndFlush();
}
示例2: TestBelongsToPlace
public void TestBelongsToPlace()
{
string drainageCode = "01-02-03-04-05-06";
string cgndbKey = "ABCDE";
Place place = new Place();
place.CgndbKey = cgndbKey;
place.CreateAndFlush();
Watershed watershed = new Watershed();
watershed.DrainageCode = drainageCode;
watershed.Place = place;
watershed.CreateAndFlush();
Watershed dbWatershed = Watershed.Find(drainageCode);
Assert.IsNotNull(dbWatershed);
Assert.IsNotNull(dbWatershed.Place);
Assert.AreEqual(cgndbKey, dbWatershed.Place.CgndbKey);
}
示例3: TestAltPlace
public void TestAltPlace()
{
int id = 37;
string cgndbKey = "ABCDE";
Place place = new Place();
place.CgndbKey = cgndbKey;
place.CreateAndFlush();
WaterBody waterbody = new WaterBody();
waterbody.Id = id;
waterbody.AltPlace = place;
waterbody.CreateAndFlush();
WaterBody dbWaterbody = WaterBody.Find(id);
Assert.IsNotNull(dbWaterbody);
Assert.IsNotNull(dbWaterbody.AltPlace);
Assert.AreEqual(cgndbKey, dbWaterbody.AltPlace.CgndbKey);
}
示例4: TestClosestWatershedToPlace
public void TestClosestWatershedToPlace()
{
string cgndbKey = "ABCDE";
Place place = new Place();
place.CgndbKey = cgndbKey;
place.CreateAndFlush();
Watershed watershed = new Watershed();
watershed.DrainageCode = "01-02-03-04-05-06";
watershed.Place = place;
watershed.CreateAndFlush();
ClosestWatershedToPlace closestWatershedToPlace = new ClosestWatershedToPlace();
closestWatershedToPlace.Place = place;
closestWatershedToPlace.Watershed = watershed;
closestWatershedToPlace.CreateAndFlush();
Place dbPlace = Place.Find(cgndbKey);
Assert.IsNotNull(dbPlace);
Assert.AreEqual(closestWatershedToPlace, place.ClosestWatershedToPlace);
}
示例5: TestRelatedInteractiveMapsNeverReturnsNull
public void TestRelatedInteractiveMapsNeverReturnsNull()
{
Assert.Ignore();
Place place = new Place();
place.CgndbKey = "ABCDE";
place.CreateAndFlush();
IList<InteractiveMap> interativeMaps = place.RelatedInteractiveMaps;
Assert.IsNotNull(interativeMaps);
Assert.AreEqual(0, interativeMaps.Count);
}