public void TicketDateTime() { SqlConnection db = new SqlConnection("Data Source=..\\SQLEXPRESS;Initial Catalog=SimpleBugs;Integrated Security=True"); SimpleBugContext bugContext = new SimpleBugContext(db); BugTicket ticket = new BugTicket(bugContext); StringAssert.IsMatch(DateTime.Now.ToString(), ticket.DateInformation.ToString()); }
public void TicketUserName() { //var configConnection = ConfigurationManager // .ConnectionStrings["SimpleBugs"] // .ConnectionString; SqlConnection db = new SqlConnection("Data Source=..\\SQLEXPRESS;Initial Catalog=SimpleBugs;Integrated Security=True"); SimpleBugContext bugContext = new SimpleBugContext(db); BugTicket ticket = new BugTicket(bugContext); StringAssert.IsMatch(System.Environment.UserName.ToString(), ticket.UserName.ToString()); }
/// <summary> /// /// </summary> public BugTicket(SimpleBugContext contextBug) { this.UserName = Environment.UserName.ToString(); this.DateInformation = DateTime.Now; }