public void TestGetCoordinateReturnsNullWhenPlaceIsNull() { Watershed watershed = new Watershed(); Assert.IsNull(watershed.Place); Assert.IsNull(watershed.GetCoordinate()); }
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(); }