Beispiel #1
0
        public static Faker <Guild> LeaderOnly(Guid?id = null)
        {
            var guild  = NoMembers(id).Generate();
            var leader = MemberFake.WithoutGuild().Generate();
            var invite = guild.InviteMember(leader, TestModelFactoryHelper.Factory)
                         .BeAccepted(TestModelFactoryHelper.Factory);

            return(new Faker <Guild>().CustomInstantiator(_ => guild));
        }
Beispiel #2
0
        public static Faker <Invite> InvalidWithoutGuild()
        {
            var member = MemberFake.WithoutGuild().Generate();

            return(new Faker <Invite>().CustomInstantiator(_ => new InviteTestProxy
            {
                Id = Guid.NewGuid(),
                member = member,
                MemberId = member.Id
            }));
        }
Beispiel #3
0
 public static Faker <Guild> Complete(Guid?id = null, int membersCount = 2)
 {
     membersCount = Math.Max(2, membersCount);
     return(new Faker <Guild>().CustomInstantiator(_ =>
     {
         var guild = NoMembers().Generate();
         foreach (var member in MemberFake.WithoutGuild().Generate(membersCount))
         {
             var invite = guild.InviteMember(member, TestModelFactoryHelper.Factory);
             invite.BeAccepted(TestModelFactoryHelper.Factory);
         }
         return guild;
     }));
 }