public void FindByName_LocationExists_ExpectLocation() { LocationImpl location = repo.FindByName("Test 1"); Assert.NotNull(location); Assert.Equal("Test 1", location.Name); }
public void FindByGuid_GivenRepoHasLocation_ExpectSameLocation() { LocationImpl location = repo.FindByName("Test 1"); LocationImpl result = repo.FindByGuid(location.Guid); Assert.NotNull(result); Assert.Equal(location, result); }
public void GetRandom_GivenListHasLocations_ExpectRandomLocation() { List <LocationImpl> locations = repo.AllAsList(); LocationImpl result = repo.GetRandom(); Assert.NotNull(result); Assert.Contains(result, locations); }
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); }
public void FindByName_LocationDoesNotExists_ExpectNull() { LocationImpl location = repo.FindByName("Test 3"); Assert.Null(location); }