Beispiel #1
0
        public static Mock <ILocationService> GetStandardMockLocationService(IEnumerable <Location> result = null)
        {
            var mockLocationService = new Mock <ILocationService>();

            mockLocationService.Setup(l => l.GetLocationsAsync(It.IsAny <IEnumerable <int> >()))
            .ReturnsAsync(result ?? FakeLocations.Get().Select(l => l.AsModel()));

            return(mockLocationService);
        }
Beispiel #2
0
        public void TestLocationDisplay()
        {
            var location = FakeLocations.Get().First().AsModel();

            location.HasAddressInfo.Should().Be(true, "Location has address info");
            location.CityState.Should().Be("Macon, GA");
            location.LatLong.Should().Be("32.8087681, -83.7358335");

            location = new Location();
            location.HasAddressInfo.Should().Be(false, "Location has no address info");
            location.CityState.Should().Be("");
            location.LatLong.Should().Be("");

            location.City = "Macon";
            location.CityState.Should().Be("Macon");
            location.HasAddressInfo.Should().Be(true, "Location has address info");

            location.City            = null;
            location.StateOrProvince = "GA";
            location.CityState.Should().Be("GA");
            location.HasAddressInfo.Should().Be(true, "Location has address info");
        }