public void CanDeploy_User_UnderGroups_By_Email() { var userDef = ModelGeneratorService.GetRandomDefinition <UserDefinition>(def => { def.LoginName = string.Empty; def.Email = Rnd.DomainUserEmail(); }); var groupDef = ModelGeneratorService.GetRandomDefinition <SecurityGroupDefinition>(def => { }); var model = SPMeta2Model.NewSiteModel(site => { site.AddSecurityGroup(groupDef, group => { group.AddUser(userDef); }); }); TestModel(model); }