public void Should_Set_The_ConnectTimeout_Option_As_Argument() { // Given var connectionTimeout = TimeSpan.FromSeconds(5.5); var fixture = new CurlUploadFileFixture { Settings = { ConnectionTimeout = connectionTimeout } }; // When var result = fixture.Run(); // Then Assert.Contains( $"--connect-timeout {connectionTimeout.TotalSeconds}", result.Args); }
public void Should_Set_The_MaxTime_Option_As_Argument() { // Given var maxTime = TimeSpan.FromSeconds(2.37); var fixture = new CurlUploadFileFixture { Settings = { MaxTime = maxTime } }; // When var result = fixture.Run(); // Then Assert.Contains( $"--max-time {maxTime.TotalSeconds}", result.Args); }
public void Should_Use_Curl_Runner_From_Tool_Path_If_Provided( string toolPath, string expected) { // Given var fixture = new CurlUploadFileFixture { Settings = { ToolPath = toolPath } }; fixture.GivenSettingsToolPathExist(); // When var result = fixture.Run(); // Then Assert.Equal(expected, result.Path.FullPath); }
public void Should_Set_The_Headers_In_Quotes_As_Argument() { // Given var fixture = new CurlUploadFileFixture { Settings = { Headers = new Dictionary <string, string> { ["name"] = "value" } } }; // When var result = fixture.Run(); // Then Assert.Contains("--header \"name:value\"", result.Args); }