public Contact Insert(string fullName, string address) { var contactList = ContactList; var contactId = 1; if(ContactList.Any()) contactId = ContactList.Max(x => x.ContactId) + 1; var contact = new Contact { ContactId = contactId, FullName = fullName, Address = address }; contactList.Add(contact); ContactList = contactList; return contact; }
private Contact InsertContact(int seed) { Assert.Ignore("Session mocking is required before this test can succeed."); var fullName = string.Format("FullName{0}", seed); var address = string.Format("Address{0}", seed); var contactList = (List<Contact>) HttpContext.Current.Session["Contacts"]; var contact = new Contact {FullName = fullName, Address = address}; contactList.Add(contact); HttpContext.Current.Session["Contacts"] = contactList; return contact; }