public void RunCleaningUseCase_ReturnsCleanedSpaces_WhenGoingForwardThenBack() { Position initialPosition = new Position(-100, -100); List <Command> commands = new List <Command>() { new Command(10, Direction.East), new Command(10, Direction.West), new Command(10, Direction.East), new Command(10, Direction.West), new Command(10, Direction.East), new Command(10, Direction.West), new Command(10, Direction.East), new Command(10, Direction.West) }; int expectedUniquePlacesCleaned = 11; Request request = new Request(initialPosition, commands); var responseHandler = new ResponseHandler(); var entitiesFactory = new EntitiesFactory(); var context = new InMemoryContext(); var locationGateway = new LocationGateway(context); var sut = new Core.UseCases.Clean(responseHandler, locationGateway, entitiesFactory); sut.Execute(request); Assert.Equal(expectedUniquePlacesCleaned, responseHandler.CleanedItems[0].UniquePlacesCleaned); }
static void Main(string[] args) { Presenter presenter = new Presenter(); var entitiesFactory = new EntitiesFactory(); var builder = new DbContextOptionsBuilder <MrRobotContext>(); builder.UseSqlServer(ReadDefaultConnectionStringFromAppSettings()); builder.UseQueryTrackingBehavior(Microsoft.EntityFrameworkCore.QueryTrackingBehavior.NoTracking); var context = new MrRobotContext(builder.Options); var locationGateway = new LocationGateway(context); var clean = new Core.UseCases.Clean(presenter, locationGateway, entitiesFactory); Startup startup = new Startup(clean); startup.Clean(); }
public int SaveLocation(Locations aLocation) { aGateway = new LocationGateway(); return(aGateway.SaveLocation(aLocation)); }
public LocationManager() { locationGateway = new LocationGateway(); }