Beispiel #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);
        }
Beispiel #2
0
        public void RepeatToStringMatch(RepeatAmount actAmount, int actCount, string pattern)
        {
            var repeat = new RepeatInfo {
                RepeatAmount = actAmount, RepeatCount = actCount
            };

            Assert.Equal(pattern, repeat.ToString());
        }
Beispiel #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();
    }
Beispiel #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();
    }
Beispiel #5
0
 public RepeatInfo(RepeatAmount amount, int times)
 {
     RepeatAmount = amount;
     RepeatCount  = times;
 }
Beispiel #6
0
 public RepeatInfo(RepeatAmount amount, int times)
 {
     RepeatAmount = amount;
     RepeatCount = times;
 }
Beispiel #7
0
 public void RepeatToStringMatch(RepeatAmount actAmount, int actCount, string pattern)
 {
     var repeat = new RepeatInfo {RepeatAmount = actAmount, RepeatCount = actCount};
     Assert.Equal(pattern, repeat.ToString());
 }
Beispiel #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);
 }