public void CorrectReplacedOldPartWhithNew() { var options = new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()); var repository = new ApplicationDbContext(options.Options); var market = new MarketServices(repository); var part = new PartsCars { Name = "Engen", Type = PartsCarsType.Engines, Speed = 100, Strength = 100, CarId = 1, Price = 100, IsDeleted = false, Id = 1, }; var car = new Cars { EngineId = 1, GearboxId = 1, TeamId = 2, AerodynamicsId = 1, BrakesId = 1, ModelCarId = 1, MountingId = 1, TurboId = null, Id = 1 }; //for Copy }
public void CorrectRentalsPilot() { var options = new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()); var repository = new ApplicationDbContext(options.Options); var marcet = new MarketServices(repository); var money = new MoneyAccountServices(repository); var pilot = new RallyPilotsServices(repository); var navigator = new RallyNavigatorsServices(repository); var car = new CarServices(repository, pilot, navigator, money); var team = new TeamServices(repository, car, money, pilot, navigator); money.CreateMoneyAccount("Pesho"); team.CreateTeamAsync("Vidin", "Pesho"); marcet.RentalsPilot(3, "Pesho", 100m); var resultPilotId = team.FindUserAsync(1).RallyPilotId; Assert.Equal(3, resultPilotId); }