コード例 #1
0
        public void GetRandom_ArrayOf_with_callback_should_work()
        {
            TestThing[] testThings = GetRandom.ArrayOf <TestThing>(7, callback: thing => thing.String1 = "xyz");

            testThings.Length.Should().Be(7);

            foreach (TestThing testThing in testThings)
            {
                testThing.String1.Should().Be("xyz");
            }
        }
コード例 #2
0
        public void GetRandom_ArrayOf_with_RandomValueProvider_should_work()
        {
            TestThing[] testThings = GetRandom.ArrayOf <TestThing>(this, 7);

            testThings.Length.Should().Be(7);

            foreach (TestThing testThing in testThings)
            {
                testThing.Guid1.Should().Be(_testGuid);
                testThing.Guid2.Should().Be(_testGuid);
            }
        }
コード例 #3
0
 public void GetRandom_ArrayOf_primitive_type_should_work()
 {
     ForTest.Scenarios
     (
         GetRandom.ArrayOf <bool>(3) as Array,
         GetRandom.ArrayOf <bool?>(3) as Array,
         GetRandom.ArrayOf <byte>(3) as Array,
         GetRandom.ArrayOf <byte?>(3) as Array,
         GetRandom.ArrayOf <byte[]>(3) as Array,
         GetRandom.ArrayOf <char>(3) as Array,
         GetRandom.ArrayOf <char?>(3) as Array,
         GetRandom.ArrayOf <DateTime>(3) as Array,
         GetRandom.ArrayOf <DateTime?>(3) as Array,
         GetRandom.ArrayOf <decimal>(3) as Array,
         GetRandom.ArrayOf <decimal?>(3) as Array,
         GetRandom.ArrayOf <double>(3) as Array,
         GetRandom.ArrayOf <double?>(3) as Array,
         GetRandom.ArrayOf <float>(3) as Array,
         GetRandom.ArrayOf <float?>(3) as Array,
         GetRandom.ArrayOf <Guid>(3) as Array,
         GetRandom.ArrayOf <Guid?>(3) as Array,
         GetRandom.ArrayOf <int>(3) as Array,
         GetRandom.ArrayOf <int?>(3) as Array,
         GetRandom.ArrayOf <long>(3) as Array,
         GetRandom.ArrayOf <long?>(3) as Array,
         GetRandom.ArrayOf <object>(3) as Array,
         GetRandom.ArrayOf <sbyte>(3) as Array,
         GetRandom.ArrayOf <sbyte?>(3) as Array,
         GetRandom.ArrayOf <short>(3) as Array,
         GetRandom.ArrayOf <short?>(3) as Array,
         GetRandom.ArrayOf <string>(3) as Array,
         GetRandom.ArrayOf <uint>(3) as Array,
         GetRandom.ArrayOf <uint?>(3) as Array,
         GetRandom.ArrayOf <ulong>(3) as Array,
         GetRandom.ArrayOf <ulong?>(3) as Array,
         GetRandom.ArrayOf <ushort>(3) as Array,
         GetRandom.ArrayOf <ushort?>(3) as Array
     )
     .TestEach(array => array.Length.Should().Be(3));
 }
コード例 #4
0
        public void GetRandom_ArrayOf_should_work()
        {
            TestThing[] testThings = GetRandom.ArrayOf <TestThing>(7);

            testThings.Length.Should().Be(7);
        }