public void ToNativeCommandShouldReturnCorrectNativeCommand(GetProcessCommand command) { // Fixture setup var expectedParameters = new CommandParameterCollection() { new CommandParameter("ComputerName", command.ComputerName) }; // Exercise system var nativeCommand = command.ToNativeCommand(); // Verify outcome nativeCommand.Should().NotBeNull(); nativeCommand.CommandText.Should().Be(command.Name); nativeCommand.Parameters.Should().BeEquivalentTo(expectedParameters); }
public void FactoryWorkerTest() { // Fixture setup var command = new GetProcessCommand { ComputerName = Environment.MachineName }; var settings = new PowerShellWorkerSettings { RemoteAddress = Environment.MachineName }; var worker = PowerShellWorkerFactory.Create(settings); // Exercise system var results = worker.RunCommand(command); var sb = new StringBuilder(); results.ForEach(r => sb.AppendLine(r)); // Verify outcome WriteMessage(sb.ToString()); }