Example #1
0
        public async Task Then_Returns_Expected_Results()
        {
            await WhenAsync();

            ReadAndParseFileResponse.Should().NotBeNull();
            ReadAndParseFileResponse.IsDirty.Should().BeTrue();
            ReadAndParseFileResponse.ErrorMessage.Should().Be(ValidationMessages.FileHeaderNotFound);
        }
        public async Task Then_Returns_Expected_Results()
        {
            await WhenAsync();

            ReadAndParseFileResponse.Should().NotBeNull();
            ReadAndParseFileResponse.IsDirty.Should().BeFalse();
            ReadAndParseFileResponse.ErrorMessage.Should().BeNullOrWhiteSpace();
            ReadAndParseFileResponse.Rows.Count.Should().Be(2);
            ReadAndParseFileResponse.Rows.Any(r => r.ValidationErrors.Count > 0).Should().BeFalse();
        }
        public async Task Then_Returns_Expected_Results()
        {
            await WhenAsync();

            ReadAndParseFileResponse.Should().NotBeNull();
            ReadAndParseFileResponse.Rows.Count.Should().Be(1);

            var actualValidationErrors = ReadAndParseFileResponse.Rows.First().ValidationErrors;

            actualValidationErrors.Count.Should().Be(_expectedValidationErrors.Count);
            actualValidationErrors.Should().BeEquivalentTo(_expectedValidationErrors);
        }
        public async Task Then_Returns_Expected_Results()
        {
            await WhenAsync();

            ReadAndParseFileResponse.Should().NotBeNull();
            ReadAndParseFileResponse.Rows.Count.Should().Be(_expectedValidationErrors.Count);

            for (var i = 0; i < _expectedValidationErrors.Count; i++)
            {
                var actualError = ReadAndParseFileResponse.Rows[i].ValidationErrors.First();

                actualError.RowNum.ToString().Should().Be(_expectedValidationErrors[i].RowNum);
                actualError.Uln.ToString().Should().Be(_expectedValidationErrors[i].Uln);
                actualError.ErrorMessage.Should().Be(_expectedValidationErrors[i].ErrorMessage);
            }
        }