Beispiel #1
0
        public static void InitialiseDbForTests(TestsDbContext dbContext)
        {
            dbContext.Products.Add(new Product
            {
                Id   = Guid.NewGuid(),
                Name = "TEST"
            });

            dbContext.SaveChanges();
        }
Beispiel #2
0
        public static void ResetDbForTests(TestsDbContext dbContext)
        {
            var members = dbContext.Products.ToArray();

            dbContext.Products.RemoveRange(members);

            dbContext.SaveChanges();

            InitialiseDbForTests(dbContext);
        }