public void CheckIfAddMotorcycleAddsTheMotorcycle() { 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.AddMotorcycle(new AddMotorcycleViewModel() { Title = "Test", Make = "BMW", Model = "HB4", Year = 2003, Price = 220, Condition = (Condition)Enum.Parse(typeof(Condition), "New"), Color = "black", FuelType = (FuelType)Enum.Parse(typeof(FuelType), "Diesel"), HorsePower = 50, CubicCentimeters = 650, Gearbox = (Gearbox)Enum.Parse(typeof(Gearbox), "Automatic"), Kilometers = 15000, Description = "asasrsa", ContactNumber = "03210320232", MainImageFile = file }, "e4bf2992-cc46-4ebb-baf2-667f245a3582"); var motorcycleOffersContainMotorcycle = dbContext.MotorcycleOffers.Any(x => x.Title == "Test"); Assert.True(motorcycleOffersContainMotorcycle); var mockMotorcycle = dbContext.MotorcycleOffers.FirstOrDefault(x => x.Title == "Test"); dbContext.MotorcycleOffers.Remove(mockMotorcycle); dbContext.SaveChanges(); }