vendredi 18 octobre 2019

Unit testing for a retry logic using c#

I would like to write a unit test that confirms my code. However, I don't know where to start.

        while (true)
        {
            var res = await this.httpClien.....

            if (res.IsSuccessStatusCode)
            {
                var result = await ..........
                this.logger.Info($"........
            }
             if (result.status == "Succesed"){
            return true;
            } Catch(Exception){

              var ..... = await ......
              this.logger.Info($".......
                 throw new Exception(resContent);
              await Task.Delay........
            }

Aucun commentaire:

Enregistrer un commentaire