Beispiel #1
0
 public void TestIsWithinBasinWhenClosestWatershedToPlaceIsNull()
 {
     Place place = new Place();
     place.ClosestWatershedToPlace = null;
     Assert.IsFalse(place.IsWithinBasin());
 }
Beispiel #2
0
        public void TestRelatedInteractiveMapsWhenIsWithinBasin()
        {
            Assert.Ignore();

            string query = "place name is the default query";
            Place place = new Place();
            place.Name = query;

            ClosestWatershedToPlace cwtp = mocks.CreateMock<ClosestWatershedToPlace>();
            place.ClosestWatershedToPlace = cwtp;

            Expect.Call(cwtp.IsWithinBasin()).Return(true).Repeat.AtLeastOnce();
            mocks.ReplayAll();

            InteractiveMap[] interactiveMaps = new InteractiveMap[3];
            for (int i = 0; i < interactiveMaps.Length; i++)
            {
                interactiveMaps[i] = new InteractiveMap();
                interactiveMaps[i].Title = "Interactive Map where " + query + ": #" + i.ToString();
                interactiveMaps[i].IsBasinMap = (i % 2) == 0 ? true : false; // even to true, odd to false
                interactiveMaps[i].CreateAndFlush();
            }

            Assert.IsTrue(place.IsWithinBasin());
            Assert.AreEqual(2, place.RelatedInteractiveMaps.Count);
            mocks.VerifyAll();
        }
Beispiel #3
0
 public void TestIsWithinBasin()
 {
     Place place = new Place();
     ClosestWatershedToPlace closestWatershedToPlace = mocks.CreateMock<ClosestWatershedToPlace>();
     Expect.Call(closestWatershedToPlace.IsWithinBasin()).Return(true);
     mocks.ReplayAll();
     place.ClosestWatershedToPlace = closestWatershedToPlace;
     Assert.IsTrue(place.IsWithinBasin());
     mocks.VerifyAll();
 }