public void TestSignUp() { UserDomain user = new UserDomain(); user.firstName = "Felipe"; user.lastName = "Gonzalez"; user.email = "*****@*****.**"; user.password = "******"; PhoneDomain phone = new PhoneDomain(); phone.area_code = 13; phone.number = 981242254; phone.country_code = "+55"; user.phones.Add(phone); var domain = provider.GetService <ISignUpDomain>(); domain.Execute(user); Assert.Equal(user.firstName, user.firstName); }
private static UserDomain ConvertToModelView(vmUser v) { UserDomain userDomain = new UserDomain(); PhoneDomain phoneDomain; userDomain.firstName = v.firstName; userDomain.lastName = v.lastName; userDomain.email = v.email; userDomain.password = v.password; userDomain.id = userDomain.email; foreach (var item in v.phones) { phoneDomain = new PhoneDomain(); phoneDomain.number = item.number; phoneDomain.area_code = item.area_code; phoneDomain.country_code = item.country_code; phoneDomain.id = item.number.ToString() + item.area_code.ToString() + item.country_code; userDomain.phones.Add(phoneDomain); } return(userDomain); }
public PhoneController(PersonDbContext context) { _context = context; _domain = new PhoneDomain(_context); }