public void InsertTest() { Assistants a = new Assistants { ID = "test", name = "test", password = "******" }; AssistantHandler ah = new AssistantHandler(a); ah.Insert(); Assert.IsTrue(AssistantHandler.DB.Assistants.First(assistant => assistant.ID == "test").Equals(a)); AssistantHandler.DB.Assistants.DeleteOnSubmit(a); AssistantHandler.DB.SubmitChanges(); }
protected bool register(string id, string pwd, string name) { Assistants a = new Assistants { ID = id, name = name, password = pwd }; AssistantHandler ah = new AssistantHandler(a); try { ah.Insert(); } catch (Exception) { return(false); } return(true); }