public void DbEntitySessionBaseTests_SessionSelectWithStringAsResultFixTest() { var context = new NorthwindContext(@"Northwind.dbc"); var session = new NorthwindSessionFix(context.Provider); var list = session.Categories.Select(x => x.CategoryName).ToList(); Console.WriteLine(string.Join("\n", list.ToArray())); Assert.AreEqual(8, list.Count); }
public void DbEntitySessionBaseTests_InsertReturnsTheAutoGeneratedPrimaryKeyValue_Test() { var context = new NorthwindContext(@"Northwind.dbc"); var session = new NorthwindSessionFix(context.Provider); var category = new Category { CategoryName = "SessionX" }; session.Categories.SetSubmitAction(category, SubmitAction.Insert); session.SubmitChanges(); Assert.AreNotEqual(0, category.CategoryId); Assert.IsNotNull(context.Categories.Where(x => x.CategoryName == category.CategoryName).SingleOrDefault()); }