<commit_before>﻿namespace SmartyStreets
{
	using NUnit.Framework;

	[TestFixture]
	public class StatusCodeSenderTests
	{
		[Test]
		public void Test200Response()
		{
			var sender = new StatusCodeSender(new MockStatusCodeSender(200));

			var response = sender.Send(new Request());

			Assert.AreEqual(200, response.StatusCode);
		}

		[Test]
		public void Test401ResponseThrowsBadCredentialsException()
		{
			Assert.Throws<BadCredentialsException>(() => AssertSend(401));
		}

		[Test]
		public void Test402ResponsePThrowsPaymentRequiredException()
		{
			Assert.Throws<PaymentRequiredException>(() => AssertSend(402));
		}

		[Test]
		public void Test413ResponseThrowsRequestEntityTooLargeException()
		{
			Assert.Throws<RequestEntityTooLargeException>(() => AssertSend(413));
		}

		[Test]
		public void Test400ResponseThrowsBadRequestException()
		{
			Assert.Throws<BadRequestException>(() => AssertSend(400));
		}

		[Test]
		public void Test429ResponseThrowsTooManyRequestsException()
		{
			Assert.Throws<TooManyRequestsException>(() => AssertSend(429));
		}

		[Test]
		public void Test500ResponseThrowsInternalServerErrorException()
		{
			Assert.Throws<InternalServerErrorException>(() => AssertSend(500));
		}

		[Test]
		public void Test503ResponseThrowsServiceUnavailableException()
		{
			Assert.Throws<ServiceUnavailableException>(() => AssertSend(503));
		}

		private static void AssertSend(int statusCode)
		{
			var sender = new StatusCodeSender(new MockStatusCodeSender(statusCode));
			sender.Send(new Request());
		}
	}
}<commit_msg>Consolidated status code sender assertions to a single test method.<commit_after>﻿namespace SmartyStreets
{
	using NUnit.Framework;

	[TestFixture]
	public class StatusCodeSenderTests
	{
		[Test]
		public void TestThrowsOnNon200Reponse()
		{
			Assert.DoesNotThrow(() => Send(200));

			Assert.Throws<BadCredentialsException>(() => Send(401));
			Assert.Throws<PaymentRequiredException>(() => Send(402));
			Assert.Throws<RequestEntityTooLargeException>(() => Send(413));
			Assert.Throws<BadRequestException>(() => Send(400));
			Assert.Throws<TooManyRequestsException>(() => Send(429));
			Assert.Throws<InternalServerErrorException>(() => Send(500));
			Assert.Throws<ServiceUnavailableException>(() => Send(503));
		}

		private static void Send(int statusCode)
		{
			var inner = new MockStatusCodeSender(statusCode);
			var sender = new StatusCodeSender(inner);
			sender.Send(new Request());
		}
	}
}
{'fraction_non_alphanumeric': 0.1257606490872211, 'fraction_numerical': 0.031643002028397565, 'mean_word_length': 5.523809523809524, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '504648', 'n_tokens_mistral': 887, 'n_tokens_neox': 738, 'n_words': 129}