Exemplo n.º 1
0
        public static IEnumerable <IMember> CreateSimpleMembers(IMemberType memberType, int amount)
        {
            var list = new List <IMember>();

            for (int i = 0; i < amount; i++)
            {
                var name = "Member No-" + i;

                MemberBuilder builder = new MemberBuilder()
                                        .WithMemberType(memberType)
                                        .WithName(name)
                                        .WithEmail("test" + i + "@test.com")
                                        .WithLogin("test" + i, "test" + i);

                builder = builder
                          .AddPropertyData()
                          .WithKeyValue("title", name + " member" + i)
                          .WithKeyValue("bodyText", "This is a subpage" + i)
                          .WithKeyValue("author", "John Doe" + i)
                          .Done();

                list.Add(builder.Build());
            }

            return(list);
        }
Exemplo n.º 2
0
        public static Member CreateSimpleMember(IMemberType memberType, string name, string email, string password, string username, Guid?key = null)
        {
            MemberBuilder builder = new MemberBuilder()
                                    .WithMemberType(memberType)
                                    .WithName(name)
                                    .WithEmail(email)
                                    .WithIsApproved(true)
                                    .WithLogin(username, password);

            if (key.HasValue)
            {
                builder = builder.WithKey(key.Value);
            }

            builder = builder
                      .AddPropertyData()
                      .WithKeyValue("title", name + " member")
                      .WithKeyValue("bodyText", "Member profile")
                      .WithKeyValue("author", "John Doe")
                      .Done();

            return(builder.Build());
        }