Beispiel #1
0
        public void FindByName_LocationExists_ExpectLocation()
        {
            LocationImpl location = repo.FindByName("Test 1");

            Assert.NotNull(location);
            Assert.Equal("Test 1", location.Name);
        }
Beispiel #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);
        }
Beispiel #3
0
        public void GetRandom_GivenListHasLocations_ExpectRandomLocation()
        {
            List <LocationImpl> locations = repo.AllAsList();
            LocationImpl        result    = repo.GetRandom();

            Assert.NotNull(result);
            Assert.Contains(result, locations);
        }
Beispiel #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);
        }
        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);
        }
Beispiel #6
0
        public void FindByName_LocationDoesNotExists_ExpectNull()
        {
            LocationImpl location = repo.FindByName("Test 3");

            Assert.Null(location);
        }