public void TestExecuteCommand()
{
Customer mrAndrewCencini;
const string originalEmail = "[email protected]";
const string anotherEmail = "[email protected]";
string replacementEmail;
using(var dbc = new AdventureWorksLT2008R2Entities())
{
dbc.Configuration.LazyLoadingEnabled = false;
mrAndrewCencini = dbc.GetDbProxy(TestAspects).Single(db => db.QueryCustomerByID(163));
replacementEmail = mrAndrewCencini.EmailAddress == originalEmail ? anotherEmail : originalEmail;
mrAndrewCencini.EmailAddress = replacementEmail;
int recordsTouched = dbc.GetDbProxy(TestAspects).ExecuteCommand(db => db.ToStringEx(""));
Assert.AreEqual(1, recordsTouched);
mrAndrewCencini = dbc.GetDbProxy(TestAspects).Single(db => db.QueryCustomerByID(163));
}
Assert.AreEqual(mrAndrewCencini.EmailAddress, replacementEmail);
//Customer mrAndrewCencini = new Customer { CustomerID = 163 };
//int retVal = AwDal.ExecuteCommand(db => db.DeleteEntity(mrAndrewCencini));
//Assert.AreEqual(1, retVal);
}