public void TestPocoMethod()
        {
            (new LagaModelDbContext()).Dispose();
            System.Data.Entity.Database.SetInitializer(new PocoLagaInitializer <LagaModelDbContext>());

            using (var context = new LagaModelDbContext())
            {
                var threadList = context.LoggerThreads.ToList();
                Assert.AreEqual(1, threadList.Count);
            }
        }
Exemple #2
0
        /// <summary>
        /// A method that should be overridden to actually add data to the context for seeding.
        ///             The default implementation does nothing.
        /// </summary>
        /// <param name="context">The context to seed. </param>
        protected override void Seed(LagaModelDbContext context)
        {
            var thread = new Generated.LoggerThread()
            {
                Title = "TEST TITLE",
                Guid  = System.Guid.NewGuid().ToString(),
            };

            context.LoggerThreads.Add(thread);

            base.Seed(context);
        }