mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
added null test for the composite click handler
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using mRemoteNG.Connection;
|
||||
using System;
|
||||
using mRemoteNG.Connection;
|
||||
using mRemoteNG.Tree;
|
||||
using NSubstitute;
|
||||
using NUnit.Framework;
|
||||
@@ -28,5 +29,11 @@ namespace mRemoteNGTests.Tree
|
||||
handler1.Received().Execute(_connectionInfo);
|
||||
handler2.Received().Execute(_connectionInfo);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ThrowWhenExecuteGivenNullArg()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => _clickHandler.Execute(null));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using mRemoteNG.Connection;
|
||||
|
||||
|
||||
@@ -10,7 +11,8 @@ namespace mRemoteNG.Tree
|
||||
|
||||
public void Execute(ConnectionInfo clickedNode)
|
||||
{
|
||||
if (clickedNode == null) return;
|
||||
if (clickedNode == null)
|
||||
throw new ArgumentNullException(nameof(clickedNode));
|
||||
foreach (var handler in ClickHandlers)
|
||||
{
|
||||
handler.Execute(clickedNode);
|
||||
|
||||
Reference in New Issue
Block a user