public void CheckIfAddElectricScooterAddsTheScooter() { var dbContext = new AutomobileDbContext(); var service = new OfferService(dbContext); IFormFile file = new FormFile(new MemoryStream(Encoding.UTF8.GetBytes("This is a dummy file")), 0, 0, "Data", "dummy.txt"); service.AddElectricScooter(new AddElectricScooterViewModel() { Title = "Test", Make = "Xiaomi", Model = "365", Year = 2003, Price = 220, Condition = (Condition)Enum.Parse(typeof(Condition), "New"), WaterproofLevel = "test", MaxSpeedAchievable = 25, MotorPower = 250, ScooterSize = "2413", TiresSize = 8.5m, TravellingDistance = 205, Battery = "test", Kilometers = 15000, Description = "asasrsa", ContactNumber = "03210320232", MainImageFile = file }, "e4bf2992-cc46-4ebb-baf2-667f245a3582"); var scooterOffersContainScooter = dbContext.ElectricScooterOffers.Any(x => x.Title == "Test"); Assert.True(scooterOffersContainScooter); var mockScooter = dbContext.ElectricScooterOffers.FirstOrDefault(x => x.Title == "Test"); dbContext.ElectricScooterOffers.Remove(mockScooter); dbContext.SaveChanges(); }