public void SetUp() { IVertex oVertex1 = new Vertex(); IVertex oVertex2 = new Vertex(); IGraph oGraph = new Graph(); oGraph.Vertices.Add(oVertex1); oGraph.Vertices.Add(oVertex2); m_oEdge = new Edge(oVertex1, oVertex2, true); m_oEdgeEventArgs = new EdgeEventArgs(m_oEdge); }
//************************************************************************* // Method: EdgeCollection_EdgeRemoved() // /// <summary> /// Handles the EdgeRemoved event on the m_oEdgeCollection object. /// </summary> /// /// <param name="oSender"> /// Standard event argument. /// </param> /// /// <param name="oEdgeEventArgs"> /// Standard event argument. /// </param> //************************************************************************* protected void EdgeCollection_EdgeRemoved( Object oSender, EdgeEventArgs oEdgeEventArgs ) { if ( oSender == null || !(oSender is EdgeCollection) ) { throw new ApplicationException( "EdgeRemoved event provided incorrect oSender argument." ); } m_bEdgeRemoved = true; m_oRemovedEdge = oEdgeEventArgs.Edge; }
public void TearDown() { m_oEdgeEventArgs = null; }
//************************************************************************* // Constructor: EdgeEventArgsTest() // /// <summary> /// Initializes a new instance of the <see cref="EdgeEventArgsTest" /> /// class. /// </summary> //************************************************************************* public EdgeEventArgsTest() { m_oEdgeEventArgs = null; m_oEdge = null; }
public void TestConstructorBad() { // Null argument. try { m_oEdgeEventArgs = new EdgeEventArgs(null); } catch (ArgumentNullException oArgumentNullException) { Assert.AreEqual( "Microsoft.NodeXL.Core." + "EdgeEventArgs.Constructor: edge argument can't be null.\r\n" + "Parameter name: edge" , oArgumentNullException.Message ); throw oArgumentNullException; } }