Esempio n. 1
0
        public static Faker <Invite> InvalidWithoutMember()
        {
            var guild = GuildFake.Complete().Generate();

            return(new Faker <Invite>().CustomInstantiator(_ => new InviteTestProxy
            {
                Id = Guid.NewGuid(),
                guild = guild,
                GuildId = guild.Id
            }));
        }
Esempio n. 2
0
        public static Faker <PagedResponse <Member> > PaginateMembers(ListMemberCommand command, int totalItems = 20)
        {
            return(new Faker <PagedResponse <Member> >().CustomInstantiator(x =>
            {
                var items = new List <Member>();
                var guild = GuildFake.Complete(id: command.GuildId, membersCount: command.PageSize).Generate();
                foreach (var member in guild.Members)
                {
                    items.Add(member.ChangeName($"{x.Name.FullName()} {command.Name}"));
                }

                return new PagedResponse <Member>(items, totalItems, command.PageSize, command.Page);
            }));
        }
Esempio n. 3
0
 public static Faker <Invite> ValidWithStatus(InviteStatuses status = InviteStatuses.Pending, Guild guild = null, Member member = null)
 {
     return(new Faker <Invite>().CustomInstantiator(_ =>
     {
         member ??= MemberFake.GuildMember().Generate();
         guild ??= GuildFake.Complete().Generate();
         var invite = guild.InviteMember(member, TestModelFactoryHelper.Factory);
         if (status == InviteStatuses.Accepted)
         {
             invite.BeAccepted(TestModelFactoryHelper.Factory);
         }
         else if (status == InviteStatuses.Denied)
         {
             invite.BeDenied();
         }
         else if (status == InviteStatuses.Canceled)
         {
             invite.BeCanceled();
         }
         return invite;
     }));
 }
Esempio n. 4
0
 public static Faker <Member> GuildLeader()
 {
     return(new Faker <Member>().CustomInstantiator(_ => GuildFake.Complete().Generate().GetLeader()));
 }