public GivenATestDiscoveryStartMessageHandler()
        {
            _dotnetTestMock = new Mock<IDotnetTest>();
            _dotnetTestMock.Setup(d => d.State).Returns(DotnetTestState.VersionCheckCompleted);
            _dotnetTestMock.Setup(d => d.PathToAssemblyUnderTest).Returns(AssemblyUnderTest);
            _dotnetTestAtVersionCheckCompletedState = _dotnetTestMock.Object;

            _testRunnerMock = new Mock<ITestRunner>();
            _testRunnerFactoryMock = new Mock<ITestRunnerFactory>();
            _testRunnerFactoryMock
                .Setup(c => c.CreateTestRunner(It.IsAny<DiscoverTestsArgumentsBuilder>()))
                .Callback<ITestRunnerArgumentsBuilder>(r => _argumentsBuilder = r as DiscoverTestsArgumentsBuilder)
                .Returns(_testRunnerMock.Object);

            _adapterChannelMock = new Mock<IReportingChannel>();

            _testRunnerChannelMock = new Mock<IReportingChannel>();
            _testRunnerChannelMock.Setup(t => t.Port).Returns(TestRunnerPort);

            _reportingChannelFactoryMock = new Mock<IReportingChannelFactory>();
            _reportingChannelFactoryMock.Setup(r =>
                r.CreateTestRunnerChannel()).Returns(_testRunnerChannelMock.Object);

            _testDiscoveryStartMessageHandler = new TestDiscoveryStartMessageHandler(
                _testRunnerFactoryMock.Object,
                _adapterChannelMock.Object,
                _reportingChannelFactoryMock.Object);

            _validMessage = new Message
            {
                MessageType = TestMessageTypes.TestDiscoveryStart
            };
        }
        public void It_generates_the_right_arguments_for_DiscoverTests()
        {
            const int port = 1;
            const string assembly = "assembly.dll";

            var discoverTestsArgumentsBuilder = new DiscoverTestsArgumentsBuilder(assembly, port);

            var arguments = discoverTestsArgumentsBuilder.BuildArguments();

            arguments.Should().BeEquivalentTo(assembly, "--list", "--designtime", "--port", $"{port}");
        }