C# 클래스 CAESDO.Recruitment.Core.Utils.Check

Design By Contract Checks. Each method generates an exception or a trace assertion statement if the contract is broken.
This example shows how to call the Require method. public void Test(int x) { try { Check.Require(x > 1, "x must be > 1"); } catch (System.Exception ex) { Console.WriteLine(ex.ToString()); } } You can direct output to a Trace listener. For example, you could insert Trace.Listeners.Clear(); Trace.Listeners.Add(new TextWriterTraceListener(Console.Out)); or direct output to a file or the Event Log. (Note: For ASP.NET clients use the Listeners collection of the Debug, not the Trace, object and, for a Release build, only exception-handling is possible.)
파일 보기 프로젝트 열기: ucdavis/Recruitments

Private Properties

프로퍼티 타입 설명
Check System

공개 메소드들

메소드 설명
Assert ( bool assertion ) : void

Assertion check.

Assert ( bool assertion, string message ) : void

Assertion check.

Assert ( bool assertion, string message, Exception inner ) : void

Assertion check.

Ensure ( bool assertion ) : void

Postcondition check.

Ensure ( bool assertion, string message ) : void

Postcondition check.

Ensure ( bool assertion, string message, Exception inner ) : void

Postcondition check.

Invariant ( bool assertion ) : void

Invariant check.

Invariant ( bool assertion, string message ) : void

Invariant check.

Invariant ( bool assertion, string message, Exception inner ) : void

Invariant check.

Require ( bool assertion ) : void

Precondition check - should run regardless of preprocessor directives.

Require ( bool assertion, string message ) : void

Precondition check - should run regardless of preprocessor directives.

Require ( bool assertion, string message, Exception inner ) : void

Precondition check - should run regardless of preprocessor directives.

비공개 메소드들

메소드 설명
Check ( ) : System

메소드 상세

Assert() 공개 정적인 메소드

Assertion check.
public static Assert ( bool assertion ) : void
assertion bool
리턴 void

Assert() 공개 정적인 메소드

Assertion check.
public static Assert ( bool assertion, string message ) : void
assertion bool
message string
리턴 void

Assert() 공개 정적인 메소드

Assertion check.
public static Assert ( bool assertion, string message, Exception inner ) : void
assertion bool
message string
inner System.Exception
리턴 void

Ensure() 공개 정적인 메소드

Postcondition check.
public static Ensure ( bool assertion ) : void
assertion bool
리턴 void

Ensure() 공개 정적인 메소드

Postcondition check.
public static Ensure ( bool assertion, string message ) : void
assertion bool
message string
리턴 void

Ensure() 공개 정적인 메소드

Postcondition check.
public static Ensure ( bool assertion, string message, Exception inner ) : void
assertion bool
message string
inner System.Exception
리턴 void

Invariant() 공개 정적인 메소드

Invariant check.
public static Invariant ( bool assertion ) : void
assertion bool
리턴 void

Invariant() 공개 정적인 메소드

Invariant check.
public static Invariant ( bool assertion, string message ) : void
assertion bool
message string
리턴 void

Invariant() 공개 정적인 메소드

Invariant check.
public static Invariant ( bool assertion, string message, Exception inner ) : void
assertion bool
message string
inner System.Exception
리턴 void

Require() 공개 정적인 메소드

Precondition check - should run regardless of preprocessor directives.
public static Require ( bool assertion ) : void
assertion bool
리턴 void

Require() 공개 정적인 메소드

Precondition check - should run regardless of preprocessor directives.
public static Require ( bool assertion, string message ) : void
assertion bool
message string
리턴 void

Require() 공개 정적인 메소드

Precondition check - should run regardless of preprocessor directives.
public static Require ( bool assertion, string message, Exception inner ) : void
assertion bool
message string
inner System.Exception
리턴 void