public void RandomCollectionOfTypeShouldReturnADifferentICollectionEachTime() { var stringCollection1 = RandomValue.ICollection <string>(); var stringCollection2 = RandomValue.ICollection <string>(); var intCollection1 = RandomValue.ICollection <int>(); var intCollection2 = RandomValue.ICollection <int>(); stringCollection1.ShouldNotEqual(stringCollection2); intCollection1.ShouldNotEqual(intCollection2); }
public void RandomIColletionWithRecursiveWillGenerateChildObjectsToTheSpecifiedDepthWithSettings() { var result = RandomValue.ICollection <ObjectWithRecursiveCollections>(Depth2Settings); result.Count().ShouldBeInRange(1, 3); var depth1 = result.FirstOrDefault(); depth1.RecursiveICollection.ShouldNotBeDefault(); depth1.Int.ShouldNotBeDefault(); depth1.RecursiveICollection.Count.ShouldBeInRange(1, 3); var depth2 = depth1.RecursiveICollection.FirstOrDefault(); depth2.RecursiveICollection.ShouldNotBeDefault(); depth2.Int.ShouldNotBeDefault(); depth2.RecursiveICollection.Count.ShouldBeInRange(1, 3); var depth3 = depth2.RecursiveICollection.FirstOrDefault(); depth3.RecursiveICollection.ShouldEqual(null); depth3.Int.ShouldNotBeDefault(); }
public void RandomCollectionOfTypeShouldReturnARandomICollectionOfTheSpecifiedSize() { var stringCollection = RandomValue.ICollection <string>(25); stringCollection.Count.ShouldEqual(25); }