Пример #1
0
 public void TestGetCoordinateReturnsNullWhenPlaceIsNull()
 {
     Watershed watershed = new Watershed();
     Assert.IsNull(watershed.Place);
     Assert.IsNull(watershed.GetCoordinate());
 }
Пример #2
0
        public void TestGetCoordinate()
        {
            double lat = 37.3;
            double lon = 73.7;
            Place place = mocks.CreateMock<Place>();
            Expect.Call(place.GetCoordinate()).Return(new LatLngCoord(lat, lon));
            mocks.ReplayAll();

            Watershed watershed = new Watershed();
            watershed.Place = place;

            LatLngCoord coord = watershed.GetCoordinate();
            Assert.AreEqual(lat, coord.Latitude);
            Assert.AreEqual(lon, coord.Longitude);

            mocks.VerifyAll();
        }