using NUnit.Framework;

namespace e_suite.Nuget.PasswordHasher.UnitTests;

[TestFixture]
public class ByteArrayExtensionsTests
{
    [Test]
    public void Concatenate_ReturnsExpectedResult()
    {
        //Arrange
        var expectedResult = new byte[6];
        expectedResult[0] = 0;
        expectedResult[1] = 1;
        expectedResult[2] = 2;
        expectedResult[3] = 3;
        expectedResult[4] = 4;
        expectedResult[5] = 5;

        var array1 = new byte[3];
        array1[0] = 0;
        array1[1] = 1;
        array1[2] = 2;

        var array2 = new byte[3];
        array2[0] = 3;
        array2[1] = 4;
        array2[2] = 5;

        //Act
        var actualResult = array1.Concatenate(array2);

        //Assert
        Assert.That(actualResult.Length, Is.EqualTo(expectedResult.Length));
        for (var i = 0; i < actualResult.Length; i++)
            Assert.That(actualResult[i], Is.EqualTo(expectedResult[i]));
    }
}