ThreadExtensionTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Tests.Extensions ThreadExtensionTests

Namespace: DeltaEngine.Tests.Extensions
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class ThreadExtensionTests

The ThreadExtensionTests type exposes the following members.

Constructors

  NameDescription
Public methodThreadExtensionTests
Initializes a new instance of the ThreadExtensionTests class
Top
Methods

  NameDescription
Public methodEnqueueWorkerThreadNoArgs
Public methodEnqueueWorkerThreadOneArg
Public methodEnqueueWorkerThreadTwoArgs
Public methodStart1
Public methodStart2
Public methodStart3
Top
Examples

[Test]
public void Start1()
{
    int num = 1;
    Assert.AreEqual(1, num);
    Thread t = ThreadExtensions.Start(() => IncrementNumber(ref num));
    t.Join();
    Assert.AreEqual(2, num);
}
[Test]
public void Start2()
{
    Thread t = ThreadExtensions.Start("thread name", () => { });
[Test]
public void Start3()
{
    const string Param = "name from parameter";
    Thread t = ThreadExtensions.Start(UpdateNameViaParameter, Param);
    t.Join();
    Assert.AreEqual(Param, t.Name);
}
[Test]
public void EnqueueWorkerThreadNoArgs()
{
    Assert.IsTrue(ThreadExtensions.EnqueueWorkerThread(() => ValueSettingTestAction()));
}
[Test]
public void EnqueueWorkerThreadOneArg()
{
    const int Num = 1;
    ThreadExtensions.EnqueueWorkerThread(Num, val => { ValueSettingTestAction(Num); });
[Test]
public void EnqueueWorkerThreadTwoArgs()
{
    const int Num1 = 1;
    const int Num2 = 2;
    ThreadExtensions.EnqueueWorkerThread(Num1, Num2,
        (val1, val2) => { ValueSettingTestAction(val1, val2); });
See Also