Пример #1
0
        public void Add(string message)
        {
            Messages = Messages == null ? new List<string>() : Messages;
            Messages.Add(message);

            //now geocode something and populate the local properties of this convo
            var locationer = new Locationer(_geocoder);
            var locationResult = locationer.GetForMessage(message);
            locationResult.Locations = locationResult.Locations ?? new List<Location>(); //bleh
            Locations = Locations == null ? new List<Location>() : Locations;

            Locations = locationResult.Locations;
        }
Пример #2
0
        public void AnyHitsFor(string message, bool shouldFindSomething)
        {
            var service = new Locationer(null);
            var parsedText = service.Parse(message);
            var query = string.Join(",", parsedText);

            var hits = service.GetForMessage(query);

            if (shouldFindSomething) {
                Assert.That(hits.Locations.Count > 0, "Expected some locations to be returned. Instead there was none.");
            }
            else {
                Assert.That(hits.Locations.Count == 0, "Expected no results. Instead found {0} locations for the phrase '{1}'", hits.Locations.Count, message);
            }
        }