public static Arbitrary <IList <BlockMap.Block[]> > PartitionsList(int count) => Arb.From(PartitionsGen().ListOf(count));
示例#2
0
 public static Arbitrary <List <Key> > KeysListArb() =>
 Arb.From(PrivateKeys(15));
示例#3
0
        public void GenArrayOfLength()
        {
            var gen = Arb.generate <int>();

            Gen.arrayOfLength(5, gen).DumpSamples(Formatters.FormatCollection);
        }
示例#4
0
 public static Arbitrary <UserClaims> UserClaims() =>
 (from name in Arb.Generate <string>()
  from email in Arb.Generate <string>()
  from id in Arb.Generate <Guid>()
  select new UserClaims(id, name, email)
 ).Pipe(Arb.From);
示例#5
0
 public static Arbitrary <Key> KeysArb() =>
 Arb.From(PrivateKey());
示例#6
0
 public static void FramebufferTextureFace(Version32 target, Version32 attachment,
                                           uint texture, int level, Version32 face)
 {
     Arb.FramebufferTextureFace((FramebufferTarget)target,
                                (FramebufferAttachment)attachment, texture, level, (TextureTarget)face);
 }
示例#7
0
 public MemberOrderingModelBasedTests()
 {
     // register the custom generators to make testing easier
     Arb.Register <ClusterGenerators>();
 }
示例#8
0
 public ByteStringSpec()
 {
     Arb.Register <Generators>();
 }
示例#9
0
 private static Gen <ErrorLine> ErrorLine()
 {
     return(Gen.zip3(
                MaybeArbitrary <NonNull <string> >()
                .Generator
                .Four(),
                Gen.zip3(Arb.Generate <Severity>(), Arb.Generate <ErrorCode>(), Arb.Generate <ErrorAlias>()),
                MaybeArbitrary <Tuple <NonNull <string>, NonNull <string> > >().Generator)
            .Select(t => new ErrorLine(
                        t.Item2.Item2,
                        t.Item2.Item1,
                        t.Item2.Item3,
                        t.Item1.Item1.Select(m => m.Get),
                        t.Item1.Item2.Select(m => m.Get),
                        t.Item1.Item3.Select(m => m.Get),
                        t.Item3.Select(m => new ErrorDescription(m.Item1.Get, m.Item2.Get)),
                        t.Item1.Item4.Select(m => m.Get))));
 }
示例#10
0
 public ChannelPipelineInvocationSpecs()
 {
     Model = new ChannelPipelineModel(true);
     Arb.Register <AllEventsChannelHandler>();
 }
示例#11
0
 // TODO: Align with JVM Akka Generator
 public static Arbitrary <ByteString> ByteStrings()
 {
     return(Arb.From(Arb.Generate <byte[]>().Select(ByteString.CopyFrom)));
 }
 internal static Arbitrary <BlockMap> BlockMaps() => Arb.From(BlockMapsGen());
 internal static Arbitrary <BlockMap.Block> FreeBlocks(BlockMap bm) => Arb.From(FreeBlocksGen(bm));
 public SegwitTransactionTest()
 {
     Arb.Register <SegwitTransactionGenerators>();
 }
        public static Arbitrary <CircularBuffer <T> > CreateCircularBuffer <T>()
        {
            var generator = Gen.Choose(1, 10).Select(i => new CircularBuffer <T>(i));

            return(Arb.From(generator));
        }
示例#16
0
 public static Arbitrary <NonWhiteSpaceString> NonWhiteSpaceString()
 {
     return(Arb.Generate <NonEmptyString>()
            .Select(str => new NonWhiteSpaceString(str))
            .ToArbitrary());
 }
 public static Arbitrary <uint> UIntArb() =>
 Arb.From(UInt32());
示例#18
0
 public static Arbitrary <PSBT> PSBTArb() => Arb.From(SanePSBT());
示例#19
0
 public static Gen <Operation <MemberOrderingState, MembershipModel> > Generator()
 {
     return(Arb.Generate <AddNewMember>().Select(x => (Operation <MemberOrderingState, MembershipModel>)x));
 }
        public void GenerateUser()
        {
            var gen = Arb.Generate <User>();

            var value = gen.Sample(0, 3);
        }
示例#21
0
 public MembershipMachine()
 {
     // register the custom generators to make testing easier
     Arb.Register <ClusterGenerators>();
 }
示例#22
0
 public static Arbitrary <ITypeSelector> Selector()
 {
     return(Arb.From(Gen.Elements(AvailableSelectors)));
 }
示例#23
0
 public static Arbitrary <DeckEntity> DeckEntity() =>
 Arb.Generate <Guid>()
 .Select(id => new DeckEntity {
     Id = id
 })
 .Pipe(Arb.From);
 public RemotePathParsingSpec()
 {
     Arb.Register(typeof(EndpointGenerators));
 }
示例#25
0
 public static Arbitrary <ExtKey> ExtKeysArb() =>
 Arb.From(ExtKey());
示例#26
0
 public static Arbitrary <BitcoinAddress> BitcoinAddressArb() =>
 Arb.From <BitcoinAddress>(RandomAddress());
示例#27
0
 public static Arbitrary <KeyPath> ExtPathArb() =>
 Arb.From(KeyPath());
示例#28
0
 public static Arbitrary <MemberStatus> MemberStatusGenerator()
 {
     return(Arb.From(Gen.Elements(Enum.GetValues(typeof(MemberStatus)).Cast <MemberStatus>())));
 }
示例#29
0
        public void GenArray2DOfDim()
        {
            var gen = Arb.generate <int>();

            Gen.array2DOfDim(2, 3, gen).DumpSamples(Formatters.Format2DArray);
        }
 public static Arbitrary <BlockMap.Block[]> Partitions() => Arb.From(PartitionsGen());