<PackageReference Include="Relativity.Server.Testing.Framework.SDK" Version="10.3.0" />

TestSession

public sealed class TestSession : IDisposable
Represents the test session. Test session scope can be global, fixture or test.
public static TestSession Current { get; set; }

Gets or sets the current session that can be unique for each parallel thread/test (using AsyncLocal<T>).

public static TestSession Global { get; }

Gets the global session that is the common and root session for tests run.

public static string TestFixtureName { get; }

Gets the name of the current test fixture.

public static string TestName { get; }

Gets the name of the current test.

public IEnumerable<TestSession> Children { get; }

Gets the collection of child sessions.

public IEnumerable<object> Entities { get; }

Gets the combined collection of all entities of parent sessions with this session.

Gets the combined collection of all entity items of parent sessions with this session.

public TestSession Parent { get; }

Gets the parent session or null for Global.

public void Add(Artifact entity)

Adds the entity to the session.

public void Add(int workspaceId, Artifact entity)

Adds the workspace entity to the session.

public IEnumerable<TEntity> All<TEntity>()

Get all the entities of particular type in session hierarchy.

public void Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public TEntity First<TEntity>()

Gets the first entity of specified type from session hierarchy.

public TEntity Last<TEntity>()

Gets the last entity of specified type from session hierarchy.

public void Remove(int entityId)

Removes an entity from the session by the specified ID.

public void Remove(int workspaceId, int entityId)

Removes an entity from the session by the specified IDs of workspace and entity.

public void SetCleanUp(object entity, bool delete)

Sets the value whether to delete the entity on cleanup.

public void SetCleanUp(IEnumerable<object> entities, bool delete)

Sets the value whether to delete the entities on cleanup.

public void SetWorking<TEntity>(TEntity entity)

Sets the entity as current working one of specified type.

Starts the child session.

public TEntity Working<TEntity>()

Gets the current working entity of specified type from session hierarchy. If there is no entity previously set using SetWorking<T> method, returns last entity of specified type added to session hierarchy.