Skip to content

Commit

Permalink
Merge pull request #134 from anaguma13/feature/14-adding-a-unit-test
Browse files Browse the repository at this point in the history
Add a test case to improve coverage

skip-ci
  • Loading branch information
natenho authored Aug 23, 2024
2 parents 786fdf8 + 8cf8cc7 commit 29c1696
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System;
using System.IO;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Xunit;

Expand Down Expand Up @@ -88,5 +89,18 @@ public async Task Returns_Null_For_Null_Body()
response.Should()
.BeNull();
}

[Fact]
public async Task Returns_Response_When_Body_Is_Set()
{
var bodyOnlyResponseTemplate = new ResponseTemplate { Body = "randomdata" };

var bodyBytes = Encoding.UTF8.GetBytes(bodyOnlyResponseTemplate.Body.ToString());

var response = await _strategy.GetResponseBodyBytesFromTemplate(bodyOnlyResponseTemplate);

response.Should()
.BeEquivalentTo(bodyBytes);
}
}
}

0 comments on commit 29c1696

Please sign in to comment.