public void CreateCommandXElement_NullActionResultExecutor_ThrowsArgumentNullException() { var nonElementCommand = new NonElementCommand("command", "#selector"); Action action = () => nonElementCommand.CreateCommandXElement(null); action.ShouldThrow <ArgumentNullException>(); }
public void CreateCommandXElement_NoArguments_ReturnsCorrectXElement() { var command = "command"; var selector = "#selector"; var nonElementCommand = new NonElementCommand(command, selector); var controllerContext = Substitute.For <ControllerContext>(); var actionResultExecutor = Substitute.For <ActionResultExecutor>(controllerContext); var result = nonElementCommand.CreateCommandXElement(actionResultExecutor); result.Name.Should().Be((XName)command); result.Should().HaveAttribute("select", selector); result.Nodes().Should().BeEmpty(); }