private User GetUser() { return user = new User() { ID = 1, EMAIL = "someMail", PASSWORD = "******", PROVINCE = 1, Province1 = new Province() { CountryProvinces = new List<CountryProvince>() { new CountryProvince() { COUNTRY_ID = 1, PROVINCE_ID = 1 } } } }; }
public void SignUpUser(string email, string password) { try { GetUserByEmail(email); } catch (NonExistingUserException exception) { try { User user = new User() { EMAIL = email, PASSWORD = password }; using (var db = new TestTaskDBEntities()) { db.Users.Add(user); db.SaveChanges(); } } catch (Exception e) { throw new Exception(String.Format("Not Able to Add User: {0}", e.Message)); } } }
public void Init() { mapperProvider = new MapperProvider(); sut = mapperProvider.GetMapper<UserMapper>(); user = GetUser(); }