private string GetTestUser(string name) { using (var context = new DbDataContext(_conf.ConnectionStrings.Deployer)) { context.Users.InsertOnSubmit(new User { Login = name, Password = name }); context.SubmitChanges(); } return name; }
public void RemoveTestData() { using (var context = new DbDataContext(_conf.ConnectionStrings.Deployer)) { var deploy = context.Deploys.Single(d => d.SessionKey == _conf.SessionKey); var user = context.Users.Single(u => u.Login == _user); context.Deploys.DeleteOnSubmit(deploy); context.Users.DeleteOnSubmit(user); context.SubmitChanges(); } }