<commit_before>﻿
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Net;

namespace Juhta.Net.WebApi.Exceptions.Tests
{
    public abstract class WebApiExceptionTests
    {
        #region Protected Methods

        protected void AssertException(ClientErrorException exception, string methodName, string errorId, string errorType, string errorMessage, HttpStatusCode statusCode)
        {
            Assert.IsNotNull(exception.CallStack);

            Assert.IsTrue(exception.CallStack[1].Contains(methodName));

            Assert.AreEqual<string>(errorId, exception.ErrorId);

            Assert.AreEqual<string>(errorType, exception.ErrorType);

            Assert.AreEqual<string>(errorMessage, exception.Message);

            Assert.AreEqual<HttpStatusCode>(statusCode, exception.StatusCode);
        }

        protected void AssertExceptions(ClientErrorException exception1, ClientErrorException exception2)
        {
            for (int i = 0; i < c_maxCallStackLinesToAssert; i++)
                Assert.AreEqual(exception1.CallStack[i], exception2.CallStack[i]);

            Assert.AreEqual<string>(exception1.ErrorId, exception2.ErrorId);

            Assert.AreEqual<string>(exception1.ErrorMessage, exception2.ErrorMessage);

            Assert.AreEqual<string>(exception1.ErrorType, exception2.ErrorType);

            Assert.AreEqual<HttpStatusCode>(exception1.StatusCode, exception2.StatusCode);
        }

        #endregion

        #region Protected Constants

        protected const int c_maxCallStackLinesToAssert = 20;

        #endregion
    }
}<commit_msg>Refactoring changes reflected by renaming of ClientErrorException.ErrorId as ClientError.ErrorCode<commit_after>﻿
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Net;

namespace Juhta.Net.WebApi.Exceptions.Tests
{
    public abstract class WebApiExceptionTests
    {
        #region Protected Methods

        protected void AssertException(ClientErrorException exception, string methodName, string errorCode, string errorType, string errorMessage, HttpStatusCode statusCode)
        {
            Assert.IsNotNull(exception.CallStack);

            Assert.IsTrue(exception.CallStack[1].Contains(methodName));

            Assert.AreEqual<string>(errorCode, exception.ErrorCode);

            Assert.AreEqual<string>(errorType, exception.ErrorType);

            Assert.AreEqual<string>(errorMessage, exception.Message);

            Assert.AreEqual<HttpStatusCode>(statusCode, exception.StatusCode);
        }

        protected void AssertExceptions(ClientErrorException exception1, ClientErrorException exception2)
        {
            for (int i = 0; i < c_maxCallStackLinesToAssert; i++)
                Assert.AreEqual(exception1.CallStack[i], exception2.CallStack[i]);

            Assert.AreEqual<string>(exception1.ErrorCode, exception2.ErrorCode);

            Assert.AreEqual<string>(exception1.ErrorMessage, exception2.ErrorMessage);

            Assert.AreEqual<string>(exception1.ErrorType, exception2.ErrorType);

            Assert.AreEqual<HttpStatusCode>(exception1.StatusCode, exception2.StatusCode);
        }

        #endregion

        #region Protected Constants

        protected const int c_maxCallStackLinesToAssert = 20;

        #endregion
    }
}
{'fraction_non_alphanumeric': 0.08558421851289832, 'fraction_numerical': 0.009711684370257967, 'mean_word_length': 3.263906856403622, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, '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': '2768491', 'n_tokens_mistral': 845, 'n_tokens_neox': 819, 'n_words': 150}