public void describe_register_user() { //before = () => DomainEvents.Register<UserRegistered>(u => expected = u.UserCreated); context["when create a user"] = () => { user = new User(new TenantId(), "teste", "master", "*****@*****.**"); it["prepares to notify"] = () => Assert.AreEqual(expected, user); }; }
public void throw_exception_when_user_password_is_null() { user = new User(new TenantId(), "user", null, "*****@*****.**"); }
public void throw_exception_when_user_name_is_empty() { user = new User(new TenantId(), "", "user", "*****@*****.**"); }
public void throw_exception_when_user_email_is_null() { user = new User(new TenantId(), "user", "password", null); }
public void throw_exception_when_user_email_is_invalid() { user = new User(new TenantId(), "user", "password", "teste"); }
public void Register(Tenant tenant, User user) { _dataContext.Tenants.Add(tenant); _dataContext.Users.Add(user); _dataContext.SaveChanges(); }