예제 #1
0
        public static Faker <Membership> Active(Guild guild = null, Member member = null)
        {
            member ??= MemberFake.GuildMember().Generate();
            guild ??= member.GetGuild();
            var membership = TestModelFactoryHelper.Factory.CreateMembership(guild, member);

            return(new Faker <Membership>().CustomInstantiator(_ => membership));
        }
예제 #2
0
 public static Faker <Membership> Finished()
 {
     return(new Faker <Membership>().CustomInstantiator(_ =>
     {
         var member = MemberFake.GuildMember().Generate();
         return member.GetState().Leave();
     }));
 }
예제 #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;
     }));
 }