当前位置: 首页>>代码示例>>C#>>正文


C# Place.Create方法代码示例

本文整理汇总了C#中Place.Create方法的典型用法代码示例。如果您正苦于以下问题:C# Place.Create方法的具体用法?C# Place.Create怎么用?C# Place.Create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Place的用法示例。


在下文中一共展示了Place.Create方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestExistsForCgndbKey

        public void TestExistsForCgndbKey()
        {
            string cgndbKey = "ABCDE";
            Place place = new Place();
            place.CgndbKey = cgndbKey;
            place.Create();

            Watershed watershed = new Watershed();
            watershed.DrainageCode = "01-02-03-04-05-06";
            watershed.Place = place;
            watershed.Create();

            Flush();

            Assert.IsTrue(Watershed.ExistsForCgndbKey(cgndbKey));
        }
开发者ID:nbadw,项目名称:sjr_atlas,代码行数:16,代码来源:WatershedTest.cs

示例2: TestFindAllByQuery

        public void TestFindAllByQuery()
        {
            string[] placeNames = { "Saint", "Saint John", "Saint John River",
                "Hammond River", "Fredericton", "Moncton", "Miramichi River" };
            for(int i=0; i < placeNames.Length; i++)
            {
                Place place = new Place();
                place.Name = placeNames[i];
                // XXX: this is technically not a valid CGNDB Key but no validation is performed
                place.CgndbKey = i.ToString();
                place.Create();
            }

            Flush();

            Assert.AreEqual(3, Place.FindAllByQuery("Saint").Count, "Query for 'Saint'");
            Assert.AreEqual(3, Place.FindAllByQuery("saint").Count, "Query for 'saint'");
            Assert.AreEqual(1, Place.FindAllByQuery("Fredericton").Count, "Query for 'Fredericton'");
            Assert.AreEqual(2, Place.FindAllByQuery("M").Count, "Query for 'M' returned");
            Assert.AreEqual(0, Place.FindAllByQuery("John").Count, "Query for 'John'");
            Assert.AreEqual(0, Place.FindAllByQuery("River").Count, "Query for 'River'");
            Assert.AreEqual(3, Place.FindAllByQuery(" Saint").Count, "Query for ' Saint'");
            Assert.AreEqual(1, Place.FindAllByQuery("Hammond River ").Count, "Query for 'Hammond River '");
        }
开发者ID:nbadw,项目名称:sjr_atlas,代码行数:24,代码来源:PlaceTest.cs

示例3: TestExistsForCgndbKeyOrAltCgndbKeyWhenWaterbodyHasAltCgndbKey

        public void TestExistsForCgndbKeyOrAltCgndbKeyWhenWaterbodyHasAltCgndbKey()
        {
            string altCgndbKey = "ABCDE";

            Place place = new Place();
            place.CgndbKey = altCgndbKey;
            place.Create();

            WaterBody waterbody = new WaterBody();
            waterbody.AltPlace = place;
            waterbody.Create();

            Flush();

            Assert.IsTrue(WaterBody.ExistsForCgndbKeyOrAltCgndbKey(altCgndbKey));
        }
开发者ID:nbadw,项目名称:sjr_atlas,代码行数:16,代码来源:WaterBodyTest.cs

示例4: TestFindByCgndbKey

        public void TestFindByCgndbKey()
        {
            string cgndbKey = "ABCDE";
            Place place = new Place();
            place.CgndbKey = cgndbKey;
            place.Create();

            Watershed watershed = new Watershed();
            watershed.DrainageCode = "01-02-03-04-05-06";
            watershed.Place = place;
            watershed.Create();

            Flush();

            Watershed foundWatershed = Watershed.FindByCgndbKey(cgndbKey);
            Assert.AreEqual(watershed, foundWatershed);
            Assert.AreEqual(place, foundWatershed.Place);
        }
开发者ID:nbadw,项目名称:sjr_atlas,代码行数:18,代码来源:WatershedTest.cs

示例5: TestFindByCgndbKeyOrAltCgndbKeyWhenWaterbodyHasCgndbKey

        public void TestFindByCgndbKeyOrAltCgndbKeyWhenWaterbodyHasCgndbKey()
        {
            string cgndbKey = "ABCDE";

            Place place = new Place();
            place.CgndbKey = cgndbKey;
            place.Create();

            WaterBody waterbody = new WaterBody();
            waterbody.Place = place;
            waterbody.Create();

            Flush();

            WaterBody foundWaterbody = WaterBody.FindByCgndbKeyOrAltCgndbKey(cgndbKey);
            Assert.AreEqual(waterbody, foundWaterbody);
            Assert.AreEqual(place, foundWaterbody.Place);
        }
开发者ID:nbadw,项目名称:sjr_atlas,代码行数:18,代码来源:WaterBodyTest.cs


注:本文中的Place.Create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。