示例#1
0
        public void RepeatParseFromString(RepeatAmount expAmount, int expCount, string pattern)
        {
            var repeat = RepeatInfo.FromString(pattern);

            Assert.Equal(expAmount, repeat.RepeatAmount);
            Assert.Equal(expCount, repeat.RepeatCount);
        }
示例#2
0
        public void RepeatToStringMatch(RepeatAmount actAmount, int actCount, string pattern)
        {
            var repeat = new RepeatInfo {
                RepeatAmount = actAmount, RepeatCount = actCount
            };

            Assert.Equal(pattern, repeat.ToString());
        }
示例#3
0
    public void BlinqShouldEqualLinqValueSequenceSelectManyResultSelector([ArrayValues] int[] sourceArr)
    {
        var sourceNativeArr = new NativeArray <int>(sourceArr, Allocator.Persistent);
        var source          = sourceNativeArr.ToValueSequence();
        var expected        = ExceptionAndValue(() => Linq.ToArray(Linq.SelectMany(source, (x) => RepeatAmount.Invoke(x), AddToIndex.Invoke)));
        var actual          = ExceptionAndValue(() => Linq.ToArray(Blinq.SelectMany(source, RepeatAmount, AddToIndex)));

        AssertAreEqual(expected, actual);
        sourceNativeArr.Dispose();
    }
示例#4
0
    public void BlinqShouldEqualLinqNativeArraySelectMany([ArrayValues] int[] sourceArr)
    {
        var sourceNativeArr = new NativeArray <int>(sourceArr, Allocator.Persistent);
        var expected        = ExceptionAndValue(() => Linq.ToArray(Linq.SelectMany(sourceNativeArr, (x) => RepeatAmount.Invoke(x))));
        var actual          = ExceptionAndValue(() => Linq.ToArray(Blinq.SelectMany(sourceNativeArr, RepeatAmount)));

        AssertAreEqual(expected, actual);
        sourceNativeArr.Dispose();
    }
示例#5
0
 public RepeatInfo(RepeatAmount amount, int times)
 {
     RepeatAmount = amount;
     RepeatCount  = times;
 }
示例#6
0
 public RepeatInfo(RepeatAmount amount, int times)
 {
     RepeatAmount = amount;
     RepeatCount = times;
 }
示例#7
0
 public void RepeatToStringMatch(RepeatAmount actAmount, int actCount, string pattern)
 {
     var repeat = new RepeatInfo {RepeatAmount = actAmount, RepeatCount = actCount};
     Assert.Equal(pattern, repeat.ToString());
 }
示例#8
0
 public void RepeatParseFromString(RepeatAmount expAmount, int expCount, string pattern)
 {
     var repeat = RepeatInfo.FromString(pattern);
     Assert.Equal(expAmount, repeat.RepeatAmount);
     Assert.Equal(expCount, repeat.RepeatCount);
 }