public void HandleInvokesGetClosestLocationsWithCorrectData()
        {
            var message = new ClosestLocationsQuery { LocationQuery = new LocationQuery { Distance = 1, Latitude = 1, Longitude = 1, MaxRecordsToReturn = 1 }};

            var dataAccess = new Mock<IAllReadyDataAccess>();
            var sut = new ClosestLocationsQueryHandler(dataAccess.Object);
            sut.Handle(message);

            dataAccess.Verify(x => x.GetClosestLocations(It.Is<LocationQuery>(y => 
                y.Distance == message.LocationQuery.Distance &&
                y.Latitude == message.LocationQuery.Latitude &&
                y.Longitude == message.LocationQuery.Longitude &&
                y.MaxRecordsToReturn == message.LocationQuery.MaxRecordsToReturn)));
        }
        public void HandleInvokesGetClosestLocationsWithCorrectData()
        {
            var message = new ClosestLocationsQuery { LocationQuery = new LocationQuery { Distance = 1, Latitude = 1, Longitude = 1, MaxRecordsToReturn = 1 }};

            var context = ServiceProvider.GetService<AllReadyContext>();
            var sut = new ClosestLocationsQueryHandler(context);
            var results = sut.Handle(message);

            Assert.Equal(results.Count, 0);

            // TODO: validate something meaningful
            /*
            dataAccess.Verify(x => x.GetClosestLocations(It.Is<LocationQuery>(y =>
                y.Distance == message.LocationQuery.Distance &&
                y.Latitude == message.LocationQuery.Latitude &&
                y.Longitude == message.LocationQuery.Longitude &&
                y.MaxRecordsToReturn == message.LocationQuery.MaxRecordsToReturn)));
            */
        }
Ejemplo n.º 3
0
        public void HandleInvokesGetClosestLocationsWithCorrectData()
        {
            var message = new ClosestLocationsQuery {
                LocationQuery = new LocationQuery {
                    Distance = 1, Latitude = 1, Longitude = 1, MaxRecordsToReturn = 1
                }
            };

            var dataAccess = new Mock <IAllReadyDataAccess>();
            var sut        = new ClosestLocationsQueryHandler(dataAccess.Object);

            sut.Handle(message);

            dataAccess.Verify(x => x.GetClosestLocations(It.Is <LocationQuery>(y =>
                                                                               y.Distance == message.LocationQuery.Distance &&
                                                                               y.Latitude == message.LocationQuery.Latitude &&
                                                                               y.Longitude == message.LocationQuery.Longitude &&
                                                                               y.MaxRecordsToReturn == message.LocationQuery.MaxRecordsToReturn)));
        }
Ejemplo n.º 4
0
        public void HandleInvokesGetClosestLocationsWithCorrectData()
        {
            var message = new ClosestLocationsQuery {
                LocationQuery = new LocationQuery {
                    Distance = 1, Latitude = 1, Longitude = 1, MaxRecordsToReturn = 1
                }
            };

            var context = ServiceProvider.GetService <AllReadyContext>();
            var sut     = new ClosestLocationsQueryHandler(context);
            var results = sut.Handle(message);

            Assert.Empty(results);

            // TODO: validate something meaningful

            /*
             * dataAccess.Verify(x => x.GetClosestLocations(It.Is<LocationQuery>(y =>
             *  y.Distance == message.LocationQuery.Distance &&
             *  y.Latitude == message.LocationQuery.Latitude &&
             *  y.Longitude == message.LocationQuery.Longitude &&
             *  y.MaxRecordsToReturn == message.LocationQuery.MaxRecordsToReturn)));
             */
        }