public static void SetMoveMadeEventArgs(MoveMadeEventArgs e)
 {
     ScenarioContext.Current[MOVE_MADE_EVENTARGS_KEY] = e;
 }
示例#2
0
 private void RaiseMoveMade(BoardPosition from, BoardPosition to, ChessPiece chessPiece)
 {
     var handler = this.MoveMade;
     if (handler != null) {
         var eventArgs = new MoveMadeEventArgs(from, to, chessPiece);
         handler(this, eventArgs);
     }
 }
 // If we were testing against a real GUI instead of just a domain model,
 // the GUI might handle events/exceptions and update a UI element such as
 // a status bar to display a message. We mimic that here by storing a message
 // in the ScenarioContext.
 private void SetMoveMadeMessage(MoveMadeEventArgs e)
 {
     string message = string.Format("{0} to {1}", e.ChessPiece.Name, e.To.Name);
     ScenarioContextUtils.SetChessBoardMessage(message);
 }