public async Task AddAsyncShouldAddEngine() { var options = new DbContextOptionsBuilder <NeedForCarsDbContext>() .UseInMemoryDatabase("AddEngineDb") .Options; var context = new NeedForCarsDbContext(options); var enginesService = new EnginesService(context); var engine = new Engine { Name = "Name1", FuelType = Models.Enums.FuelType.Diesel, MaxHP = 100, Creator = "Creator" }; await enginesService.AddAsync(engine); var result = await context.Engines.CountAsync(); Assert.Equal(1, result); }