Persistate API documentation
WriteTestAssociations Method (target, slot, parameters)
NamespacesPersistatePersistentWriteTestAssociations(IClassified, Int32, CreateTestDataParameterSet)

[This is preliminary documentation and is subject to change.]

Creates test association(s) for an associated member of this object.
Declaration Syntax
public virtual void WriteTestAssociations(
	IClassified target,
	int slot,
	CreateTestDataParameterSet parameters
target (IClassified)
The associated object or collection within this object.
slot (Int32)
The member slot occupied by the target association.
parameters (CreateTestDataParameterSet)
An object containing parameters used in creating the test data. This contains values determining the range of several and many collection sizes to create, and also a list of object classes determining which types of object should be created.

This method is used along with WriteTestData by the CreateTestData operation to create an entire tree of test objects for your application. This method works only for associations which have a from clause in the definition file - within clauses are not handled.

If the target is a scalar association, it is set to a random member of the source collection determined by the from clause, but only if it is currently null. If the target is an associated collection, it is filled with a number of associations to the source collection (determined by the test parameters) but only if the collection is currently empty.

You can override this method to provide less random associations, or to cater for associations with no from clause.

Assembly: Persistate (Module: Persistate) Version: (