Skip to content

DirectSQL/HrTask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HrTask

Task of Head Result and Task for Remain
Build Status
CodeFactor

Test Run

public void TestRun()
{
    var task = new HrTask<int, int[]>(() => {
        return (
            1,
            () => new int[] { 2, 3 }
        );
    });

    task.Start();

    var result = task.Result;
    Assert.AreEqual(result.headResult, 1);

    var remainResult = result.remainTask.Result;
    CollectionAssert.AreEqual(remainResult, new int[] { 2, 3 });
}

Test Async

public async Task TestAsync()
{
    var task = new HrTask<int, int[]>(() => {
        return (
            1,
            () => new int[] { 2, 3 }
        );
    });

    task.Start();

    var result = await task;
    Assert.AreEqual(result.headResult, 1);

    var remainResult = await result.remainTask;
    CollectionAssert.AreEqual(remainResult, new int[] { 2, 3 });
}

About

Task of Head Result and Task for Remain

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages