0

I am using swagger.io sample Pet Store as a demo, and wanted to run some of the unit tests provided in the csharp client export. Under the Authorize link it informs their is a username and password configured "test", "abc123". I set up the configuration as follows:

    [SetUp]
    public void Init()
    {
        var apiKey = new Dictionary<string, string>();
        apiKey.Add("ApiKey", "special-key");
        var config = new Configuration()
        {
            //ApiKey = apiKey,
            //AccessToken = "special-key",
            Username = "test",
            Password = "abs123",
        };
        instance = new PetApi(config);
    }

When I setup and debug the following unit test:

    [Test]
    public void AddPetTest()
    {
        // TODO uncomment below to test the method and replace null with proper value
        var pet = new Pet(name: "TEST", photoUrls: new List<string> { "http://" });
        instance.AddPet(pet);

    }

I get error:

IO.Swagger.Client.ApiException: 'Error calling AddPet: The request was aborted: Could not create SSL/TLS secure channel.'

I did hunt a bit for the documentation. Is their any documentation on how to configure authentication to use the sample Pet Store?

Thanks.

Adam Cox
  • 3,341
  • 1
  • 36
  • 46
  • [Does this help?](https://stackoverflow.com/a/2904963/113116) – Helen Jun 06 '19 at 14:19
  • Thanks. I did come across this SO, but could not understand how it would apply to my scenario. My scenario can be replicated by anyone who pulls down the csharp client and attempts to run the unit test. – Adam Cox Jun 06 '19 at 18:45

0 Answers0