[TestMethod] public void CreateEmailTest() { var r = GetRandom.Object <EmailAddressData>(); var o = AddressFactory.CreateEmail(r.ID, r.Address, r.ValidFrom, r.ValidTo); Assert.IsInstanceOfType(o, typeof(EmailAddress)); testVariables(o.Data, r.ID, r.Address, r.ValidFrom, r.ValidTo); }
public async Task <IActionResult> CreateEmail( [Bind(emailProperties)] EMailAddressView c) { if (!ModelState.IsValid) { return(View(c)); } c.ID = c.ID ?? Guid.NewGuid().ToString(); var o = AddressFactory.CreateEmail(c.ID, c.EmailAddress, c.ValidFrom, c.ValidTo); await addresses.AddObject(o); return(RedirectToAction("Index")); }