C# Class NSoft.NFramework.UnitTesting.TestTool

단위 테스트 시 필요한 함수들 (대부분 멅티스레드로 테스트를 수행합니다)
显示文件 Open project: debop/NFramework

Public Methods

Method Description
RunTaskQueue ( int count ) : void

actionscount 수 만큼 순서대로 수행합니다.

RunTasks ( int count ) : void

지정된 Action들을 지정된 횟수만큼 병렬 방식으로 실행합니다. 멀티스레드 테스트가 가능합니다.

RunTasks ( int count, System.Action @action ) : void

지정된 Action을 지정된 횟수만큼 병렬로 실행합니다. 멀티스레드 테스트가 가능합니다.

RunTasks ( int fromInclusive, int toExclusive ) : void

actions를 지정된 범위만큼 수행합니다.

RunTasks ( int fromInclusive, int toExclusive, Action @actions ) : void

actions를 지정한 범위만큼 수행합니다.

RunThread ( int maxThreads, int workerThreads, WaitCallback callback = null ) : void

ThreadPool 에 callback 을 지정된 갯수만큼 넣고 실행시킵니다. 일반적으로 Thread 컬렉션보다 성능이 좋습니다.

ThreadStress ( this testMethod, int threadCount = 4 ) : void

지정된 Thread 메소드에 대해, 갯수 만큼 Thread 를 만들어서 실행시킨다. (ThreadPool 을 사용하는게 아니므로, 좋은 방법은 아닙니다. TestTool.RunTasks(int,System.Action)을 사용하세요.

ThreadStress ( this threads ) : void

지정된 Thread 컬렉션들을 모두 실행시킵니다.

ThreadStressByThreadPool ( IEnumerable callbacks, int count = 4 ) : void

ThreadPool을 이용하여, 지정한 callback 함수들을 지정한 갯수만큼 수행합니다.

ThreadStressByThreadPool ( WaitCallback callback, IEnumerable states ) : void

ThreadPool을 이용하여, 지정된 callback 함수를 지정된 state 인자값 수만큼 실행합니다.

ThreadStressByThreadPool ( WaitCallback callback, int count = 4 ) : void

ThreadPool을 이용하여, 지정한 callback 함수를 지정한 갯수만큼 수행합니다.

Method Details

RunTaskQueue() public static method

actionscount 수 만큼 순서대로 수행합니다.
public static RunTaskQueue ( int count ) : void
count int
return void

RunTasks() public static method

지정된 Action들을 지정된 횟수만큼 병렬 방식으로 실행합니다. 멀티스레드 테스트가 가능합니다.
public static RunTasks ( int count ) : void
count int
return void

RunTasks() public static method

지정된 Action을 지정된 횟수만큼 병렬로 실행합니다. 멀티스레드 테스트가 가능합니다.
public static RunTasks ( int count, System.Action @action ) : void
count int
@action System.Action
return void

RunTasks() public static method

actions를 지정된 범위만큼 수행합니다.
public static RunTasks ( int fromInclusive, int toExclusive ) : void
fromInclusive int
toExclusive int
return void

RunTasks() public static method

actions를 지정한 범위만큼 수행합니다.
public static RunTasks ( int fromInclusive, int toExclusive, Action @actions ) : void
fromInclusive int
toExclusive int
@actions Action
return void

RunThread() public static method

ThreadPool 에 callback 을 지정된 갯수만큼 넣고 실행시킵니다. 일반적으로 Thread 컬렉션보다 성능이 좋습니다.
public static RunThread ( int maxThreads, int workerThreads, WaitCallback callback = null ) : void
maxThreads int
workerThreads int
callback WaitCallback
return void

ThreadStress() public static method

지정된 Thread 메소드에 대해, 갯수 만큼 Thread 를 만들어서 실행시킨다. (ThreadPool 을 사용하는게 아니므로, 좋은 방법은 아닙니다. TestTool.RunTasks(int,System.Action)을 사용하세요.
public static ThreadStress ( this testMethod, int threadCount = 4 ) : void
testMethod this 실행할 메소드를 ThreadStart로 delegate 한 메소드
threadCount int 수행할 횟수
return void

ThreadStress() public static method

지정된 Thread 컬렉션들을 모두 실행시킵니다.
public static ThreadStress ( this threads ) : void
threads this
return void

ThreadStressByThreadPool() public static method

ThreadPool을 이용하여, 지정한 callback 함수들을 지정한 갯수만큼 수행합니다.
public static ThreadStressByThreadPool ( IEnumerable callbacks, int count = 4 ) : void
callbacks IEnumerable 수행할 callback 함수들
count int callback 함수 수행 횟수
return void

ThreadStressByThreadPool() public static method

ThreadPool을 이용하여, 지정된 callback 함수를 지정된 state 인자값 수만큼 실행합니다.
public static ThreadStressByThreadPool ( WaitCallback callback, IEnumerable states ) : void
callback WaitCallback
states IEnumerable
return void

ThreadStressByThreadPool() public static method

ThreadPool을 이용하여, 지정한 callback 함수를 지정한 갯수만큼 수행합니다.
public static ThreadStressByThreadPool ( WaitCallback callback, int count = 4 ) : void
callback WaitCallback
count int
return void