Ejemplo n.º 1
0
        public void FindByName_LocationExists_ExpectLocation()
        {
            LocationImpl location = repo.FindByName("Test 1");

            Assert.NotNull(location);
            Assert.Equal("Test 1", location.Name);
        }
Ejemplo n.º 2
0
        public void FindByGuid_GivenRepoHasLocation_ExpectSameLocation()
        {
            LocationImpl location = repo.FindByName("Test 1");
            LocationImpl result   = repo.FindByGuid(location.Guid);

            Assert.NotNull(result);
            Assert.Equal(location, result);
        }
Ejemplo n.º 3
0
        public void GetRandom_GivenListHasLocations_ExpectRandomLocation()
        {
            List <LocationImpl> locations = repo.AllAsList();
            LocationImpl        result    = repo.GetRandom();

            Assert.NotNull(result);
            Assert.Contains(result, locations);
        }
Ejemplo n.º 4
0
        public void NextLocation_GivenCorrectLocation_ExpectLocation()
        {
            LocationImpl location    = repo.FindByName("Test 1");
            LocationImpl newLocation = new LocationImpl();

            locationService.Setup(service => service.NextLocation(It.IsAny <LocationImpl>(),
                                                                  It.IsAny <ConcurrentBag <LocationImpl> >(), It.IsAny <List <Guid> >())).Returns(newLocation);

            LocationImpl result = repo.NextLocation(location.Guid, new List <Guid>());

            Assert.Equal(newLocation, result);
        }
Ejemplo n.º 5
0
        public void Location_SetFields_ExpectCorrectValues()
        {
            Coordinate   coordinates = new Coordinate(50.0, 5.0);
            LocationImpl location    = new LocationImpl()
            {
                Coordinates  = coordinates,
                LocationType = LocationType.STAND,
                Name         = "Test location"
            };

            Assert.Equal("Test location", location.Name);
            Assert.Equal(coordinates, location.Coordinates);
            Assert.Equal(LocationType.STAND, location.LocationType);
            Assert.False(location.Guid == Guid.Empty);
        }
Ejemplo n.º 6
0
        public void FindByName_LocationDoesNotExists_ExpectNull()
        {
            LocationImpl location = repo.FindByName("Test 3");

            Assert.Null(location);
        }