public void Must_Support_Circular_Referenced_Types() { var randomValue = new RandomValue(); RandomValue.Object <A>(); var a = RandomValue.Object <A>(); Assert.IsTrue(a.AList.Count >= 1); Assert.IsTrue(a.ReadOnlyList.Count >= 1); Assert.IsTrue(a.A2.ReadOnlyList.Count >= 1); Assert.IsTrue(a.IReadOnlyCollectionProperty.Count >= 1); for (var i = 0; i < 10; i++) { randomValue.Object(typeof(A)); } Assert.AreEqual(0, randomValue._objectCreationStack.Count); }
public void String_With_Length_Parameter() { var len = 5432; Assert.AreEqual(len, RandomValue.String(len).Length); }
public void ShouldSupportByteArray() { var instance = RandomValue.Object <ByteArrayFieldContainer>(); instance.Bytes.Length.Should().BeGreaterThan(0); }
/// <summary> /// Objects this instance. /// </summary> public static T Object <T>() where T : new() { var randomValue = new RandomValue(); return((T)randomValue.Object(typeof(T))); }