public void IndexedAccess_ReturnsCorrectErrorMessage()
        {
            var testedIndex = testErrors.Length - 1;

            var testErrorCollection = PathValidationErrorsCollection.CreateWithErrorsAtPath(testErrors, "any Path");

            testErrorCollection[testedIndex].Should().Be(testErrors[testedIndex]);
        }
        public void Count_ReturnsCorrectErrorCount()
        {
            var expectedErrorCount = testErrors.Length;

            var testCollection = PathValidationErrorsCollection.CreateWithErrorsAtPath(testErrors, "any Path");

            testCollection.Count.Should().Be(expectedErrorCount);
        }
        public void CreateWithErrorsAtPath_CreatesCollectionWithCorrectPath()
        {
            var testPath = "testpath";

            var testCollection = PathValidationErrorsCollection.CreateWithErrorsAtPath(new[] { "any error" }, testPath);

            testCollection.Path.Should().Be(testPath);
        }
        public void IndexedAccess_ThrowsExceptionIfIndexOutOfRange()
        {
            var testedIndex         = testErrors.Length;
            var testErrorCollection = PathValidationErrorsCollection.CreateWithErrorsAtPath(testErrors, "any Path");

            Action indexedAccess = () => _ = testErrorCollection[testedIndex];

            indexedAccess.Should().ThrowExactly <IndexOutOfRangeException>();
        }
        public void CreateWithErrorsAtPath_CreatesCollectionWithAllPassedErrors()
        {
            var testCollection = PathValidationErrorsCollection.CreateWithErrorsAtPath(testErrors, "any Path");

            testCollection.Should().BeEquivalentTo(testErrors);
        }