예제 #1
0
        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));
        }
예제 #2
0
        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);
        }