public void Constructor_GiveValidArguments_PropertiesAreSet() { var @event = new UserEnabledEvent("email-address", "first-name", "last-name"); Assert.Equal("email-address", @event.EmailAddress); Assert.Equal("first-name", @event.FirstName); Assert.Equal("last-name", @event.LastName); }
public void Handle(UserEnabledEvent evnt) { try { Email.Send(evnt.UserEmail, "【无需回复】您的账号已经启用", string.Format("您的账号已经被管理员启用,您可以使用您的账号登录了,如果您有任何疑问请和管理员联系。{0}", evnt.EnableDate)); } catch (Exception ex) { Log.Instance.Error(ex); } }
private void Apply(UserEnabledEvent @event) { IsActive = @event.IsActive; }