Ejemplo n.º 1
0
        public async Task HandleAsync_SavesDataUpload()
        {
            // Arrange
            var builder = new ProcessDataReturnXmlFileHandlerBuilder();

            var schemeReturn = new SchemeReturn()
            {
                ComplianceYear = "2016", ReturnPeriod = SchemeReturnReturnPeriod.Quarter1JanuaryMarch
            };
            var xmlGeneratorResult = new GenerateFromDataReturnXmlResult <SchemeReturn>(A.Dummy <string>(),
                                                                                        schemeReturn, new List <XmlValidationError>());

            A.CallTo(() => builder.XmlGenerator.GenerateDataReturns <SchemeReturn>(A <ProcessDataReturnXmlFile> ._))
            .Returns(xmlGeneratorResult);

            A.CallTo(() => builder.DataReturnVersionFromXmlBuilder.Build(A <SchemeReturn> ._))
            .Returns(new DataReturnVersionBuilderResult(A.Dummy <DataReturnVersion>(), A.Dummy <List <ErrorData> >()));

            // Act
            await builder.InvokeHandleAsync();

            // Assert
            A.CallTo(() => builder.DataAccess.AddAndSaveAsync(A <DataReturnUpload> ._))
            .MustHaveHappened(Repeated.Exactly.Once);
        }
        public async Task HandleAsync_XmlContainsSchemaError_CreatesDataReturnUpload_WithNullComplianceYearAndQuarter()
        {
            using (DatabaseWrapper database = new DatabaseWrapper())
            {
                // Arrange
                ModelHelper helper = new ModelHelper(database.Model);
                DomainHelper domainHelper = new DomainHelper(database.WeeeContext);

                var organisation = helper.CreateOrganisation();
                helper.CreateScheme(organisation);

                database.Model.SaveChanges();

                var builder = new ProcessDataReturnXmlFileHandlerBuilder(database.WeeeContext);

                var xmlGeneratorResult = new GenerateFromDataReturnXmlResult<SchemeReturn>(
                    "Test XML string",
                    A.Dummy<SchemeReturn>(),
                    new List<XmlValidationError> { new XmlValidationError(ErrorLevel.Error, XmlErrorType.Schema, "Error text") });

                A.CallTo(() => builder.XmlGenerator.GenerateDataReturns<SchemeReturn>(A<ProcessDataReturnXmlFile>._))
                     .Returns(xmlGeneratorResult);

                // Act
                var dataReturnUploadId = await builder.InvokeHandleAsync(organisation.Id);

                // Assert
                var dataReturnUpload = domainHelper.GetDataReturnUpload(dataReturnUploadId);

                Assert.Null(dataReturnUpload.ComplianceYear);
                Assert.Null(dataReturnUpload.Quarter);
            }
        }
Ejemplo n.º 3
0
        public async Task HandleAsync_XmlContainsSchemaError_CreatesDataReturnUpload_WithNullComplianceYearAndQuarter()
        {
            using (DatabaseWrapper database = new DatabaseWrapper())
            {
                // Arrange
                ModelHelper  helper       = new ModelHelper(database.Model);
                DomainHelper domainHelper = new DomainHelper(database.WeeeContext);

                var organisation = helper.CreateOrganisation();
                helper.CreateScheme(organisation);

                database.Model.SaveChanges();

                var builder = new ProcessDataReturnXmlFileHandlerBuilder(database.WeeeContext);

                var xmlGeneratorResult = new GenerateFromDataReturnXmlResult <SchemeReturn>(
                    "Test XML string",
                    A.Dummy <SchemeReturn>(),
                    new List <XmlValidationError> {
                    new XmlValidationError(ErrorLevel.Error, XmlErrorType.Schema, "Error text")
                });

                A.CallTo(() => builder.XmlGenerator.GenerateDataReturns <SchemeReturn>(A <ProcessDataReturnXmlFile> ._))
                .Returns(xmlGeneratorResult);

                // Act
                var dataReturnUploadId = await builder.InvokeHandleAsync(organisation.Id);

                // Assert
                var dataReturnUpload = domainHelper.GetDataReturnUpload(dataReturnUploadId);

                Assert.Null(dataReturnUpload.ComplianceYear);
                Assert.Null(dataReturnUpload.Quarter);
            }
        }
        public async Task HandleAsync_XmlContainsSchemaError_StoresAvailableDataReturnData()
        {
            using (DatabaseWrapper database = new DatabaseWrapper())
            {
                // Arrange
                ModelHelper helper = new ModelHelper(database.Model);
                DomainHelper domainHelper = new DomainHelper(database.WeeeContext);

                var organisation = helper.CreateOrganisation();
                var scheme = helper.CreateScheme(organisation);

                database.Model.SaveChanges();

                var builder = new ProcessDataReturnXmlFileHandlerBuilder(database.WeeeContext);

                var xmlGeneratorResult = new GenerateFromDataReturnXmlResult<SchemeReturn>(
                    "Test XML string",
                    A.Dummy<SchemeReturn>(),
                    new List<XmlValidationError> { new XmlValidationError(ErrorLevel.Error, XmlErrorType.Schema, "Error text") });

                A.CallTo(() => builder.XmlGenerator.GenerateDataReturns<SchemeReturn>(A<ProcessDataReturnXmlFile>._))
                     .Returns(xmlGeneratorResult);

                // Act
                var dataReturnUploadId = await builder.InvokeHandleAsync(organisation.Id, fileName: "XML file name");

                // Assert
                var dataReturnUpload = domainHelper.GetDataReturnUpload(dataReturnUploadId);

                Assert.Equal(scheme.Id, dataReturnUpload.Scheme.Id);
                Assert.Equal("Test XML string", dataReturnUpload.RawData.Data);
                Assert.Equal("XML file name", dataReturnUpload.FileName);
                Assert.NotEqual(TimeSpan.Zero, dataReturnUpload.ProcessTime);
            }
        }
Ejemplo n.º 5
0
        public async Task HandleAsync_XmlContainsBusinessErrorAndWarning_StoresBusinessErrorAndWarning()
        {
            using (DatabaseWrapper database = new DatabaseWrapper())
            {
                // Arrange
                ModelHelper  helper       = new ModelHelper(database.Model);
                DomainHelper domainHelper = new DomainHelper(database.WeeeContext);

                var organisation      = helper.CreateOrganisation();
                var scheme            = helper.CreateScheme(organisation);
                var dataReturnVersion = helper.CreateDataReturnVersion(scheme, 2016, 3, false);

                database.Model.SaveChanges();

                var builder = new ProcessDataReturnXmlFileHandlerBuilder(database.WeeeContext);

                var schemeReturn = new SchemeReturn()
                {
                    ComplianceYear = "2016",
                    ReturnPeriod   = SchemeReturnReturnPeriod.Quarter3JulySeptember
                };

                var xmlGeneratorResult = new GenerateFromDataReturnXmlResult <SchemeReturn>(
                    "Test XML string",
                    schemeReturn,
                    new List <XmlValidationError>());

                A.CallTo(() => builder.XmlGenerator.GenerateDataReturns <SchemeReturn>(A <ProcessDataReturnXmlFile> ._))
                .Returns(xmlGeneratorResult);

                var dbDataReturnVersion     = domainHelper.GetDataReturnVersion(dataReturnVersion.Id);
                var businessErrorAndWarning = new List <ErrorData>
                {
                    new ErrorData("Error text", ErrorLevel.Error),
                    new ErrorData("Warning text", ErrorLevel.Warning)
                };

                var dataReturnVersionBuilderResult = new DataReturnVersionBuilderResult(dbDataReturnVersion, businessErrorAndWarning);

                A.CallTo(() => builder.DataReturnVersionFromXmlBuilder.Build(A <SchemeReturn> ._))
                .Returns(dataReturnVersionBuilderResult);

                // Act
                var dataReturnUploadId = await builder.InvokeHandleAsync(organisation.Id);

                // Assert
                var dataReturnUpload = domainHelper.GetDataReturnUpload(dataReturnUploadId);

                Assert.Equal(2, dataReturnUpload.Errors.Count);
                Assert.All(dataReturnUpload.Errors, e => Assert.Equal(Domain.Error.UploadErrorType.Business, e.ErrorType));
                Assert.Contains(dataReturnUpload.Errors, p => p.ErrorLevel == Domain.Error.ErrorLevel.Error && p.Description == "Error text");
                Assert.Contains(dataReturnUpload.Errors, p => p.ErrorLevel == Domain.Error.ErrorLevel.Warning && p.Description == "Warning text");
            }
        }
Ejemplo n.º 6
0
        public async Task HandleAsync_XmlDoesNotContainSchemaError_StoresAvailableDataReturnData()
        {
            using (DatabaseWrapper database = new DatabaseWrapper())
            {
                // Arrange
                ModelHelper  helper       = new ModelHelper(database.Model);
                DomainHelper domainHelper = new DomainHelper(database.WeeeContext);

                var organisation      = helper.CreateOrganisation();
                var scheme            = helper.CreateScheme(organisation);
                var dataReturnVersion = helper.CreateDataReturnVersion(scheme, 2016, 3, false);

                database.Model.SaveChanges();

                var builder = new ProcessDataReturnXmlFileHandlerBuilder(database.WeeeContext);

                var schemeReturn = new SchemeReturn()
                {
                    ComplianceYear = "2016",
                    ReturnPeriod   = SchemeReturnReturnPeriod.Quarter3JulySeptember
                };

                var xmlGeneratorResult = new GenerateFromDataReturnXmlResult <SchemeReturn>(
                    "Test XML string",
                    schemeReturn,
                    new List <XmlValidationError>());

                A.CallTo(() => builder.XmlGenerator.GenerateDataReturns <SchemeReturn>(A <ProcessDataReturnXmlFile> ._))
                .Returns(xmlGeneratorResult);

                var dbDataReturnVersion            = domainHelper.GetDataReturnVersion(dataReturnVersion.Id);
                var dataReturnVersionBuilderResult = new DataReturnVersionBuilderResult(dbDataReturnVersion, A.Dummy <List <ErrorData> >());

                A.CallTo(() => builder.DataReturnVersionFromXmlBuilder.Build(A <SchemeReturn> ._))
                .Returns(dataReturnVersionBuilderResult);

                // Act
                var dataReturnUploadId = await builder.InvokeHandleAsync(organisation.Id, fileName : "XML file name");

                // Assert
                var dataReturnUpload = domainHelper.GetDataReturnUpload(dataReturnUploadId);

                Assert.Equal(scheme.Id, dataReturnUpload.Scheme.Id);
                Assert.Equal("Test XML string", dataReturnUpload.RawData.Data);
                Assert.Equal("XML file name", dataReturnUpload.FileName);
                Assert.Equal(2016, dataReturnUpload.ComplianceYear);
                Assert.Equal(Convert.ToInt32(QuarterType.Q3), dataReturnUpload.Quarter);
                Assert.NotEqual(TimeSpan.Zero, dataReturnUpload.ProcessTime);
            }
        }
        public async Task HandleAsync_SchemaErrors_DoesNotPerformBusinessValidation()
        {
            // Arrange
            var builder = new ProcessDataReturnXmlFileHandlerBuilder();

            var schemeReturn = new SchemeReturn() { ComplianceYear = "2016", ReturnPeriod = SchemeReturnReturnPeriod.Quarter1JanuaryMarch };
            var xmlGeneratorResult = new GenerateFromDataReturnXmlResult<SchemeReturn>(A.Dummy<string>(),
                schemeReturn, new List<XmlValidationError> { new XmlValidationError(Core.Shared.ErrorLevel.Error, XmlErrorType.Schema, "Test") });

            A.CallTo(() => builder.XmlGenerator.GenerateDataReturns<SchemeReturn>(A<ProcessDataReturnXmlFile>._))
                .Returns(xmlGeneratorResult);

            // Act
            await builder.InvokeHandleAsync();

            // Assert
            A.CallTo(() => builder.DataReturnVersionFromXmlBuilder.Build(A<SchemeReturn>._)).MustNotHaveHappened();
        }
        public async Task HandleAsync_UserNotAssociatedWithScheme_ThrowsSecurityException()
        {
            // Arrange
            var builder = new ProcessDataReturnXmlFileHandlerBuilder();
            builder.Authorization = new AuthorizationBuilder()
                .DenySchemeAccess()
                .Build();

            var handler = builder.Build();

            var message = A.Dummy<ProcessDataReturnXmlFile>();

            // Act
            Func<Task<Guid>> testCode = async () => await handler.HandleAsync(message);

            // Assert
            await Assert.ThrowsAsync<SecurityException>(testCode);
        }
Ejemplo n.º 9
0
        public async Task HandleAsync_UserNotAssociatedWithScheme_ThrowsSecurityException()
        {
            // Arrange
            var builder = new ProcessDataReturnXmlFileHandlerBuilder();

            builder.Authorization = new AuthorizationBuilder()
                                    .DenySchemeAccess()
                                    .Build();

            var handler = builder.Build();

            var message = A.Dummy <ProcessDataReturnXmlFile>();

            // Act
            Func <Task <Guid> > testCode = async() => await handler.HandleAsync(message);

            // Assert
            await Assert.ThrowsAsync <SecurityException>(testCode);
        }
Ejemplo n.º 10
0
        public async Task HandleAsync_XmlContainsSchemaError_StoresSchemaErrors()
        {
            using (DatabaseWrapper database = new DatabaseWrapper())
            {
                // Arrange
                ModelHelper  helper       = new ModelHelper(database.Model);
                DomainHelper domainHelper = new DomainHelper(database.WeeeContext);

                var organisation = helper.CreateOrganisation();
                var scheme       = helper.CreateScheme(organisation);

                database.Model.SaveChanges();

                var builder = new ProcessDataReturnXmlFileHandlerBuilder(database.WeeeContext);

                var xmlGeneratorResult = new GenerateFromDataReturnXmlResult <SchemeReturn>(
                    "Test XML string",
                    A.Dummy <SchemeReturn>(),
                    new List <XmlValidationError>
                {
                    new XmlValidationError(ErrorLevel.Error, XmlErrorType.Schema, "Error text1"),
                    new XmlValidationError(ErrorLevel.Error, XmlErrorType.Schema, "Error text2")
                });

                A.CallTo(() => builder.XmlGenerator.GenerateDataReturns <SchemeReturn>(A <ProcessDataReturnXmlFile> ._))
                .Returns(xmlGeneratorResult);

                // Act
                var dataReturnUploadId = await builder.InvokeHandleAsync(organisation.Id);

                // Assert
                var dataReturnUpload = domainHelper.GetDataReturnUpload(dataReturnUploadId);

                Assert.Equal(2, dataReturnUpload.Errors.Count);
                Assert.All(dataReturnUpload.Errors, e => Assert.Equal(Domain.Error.UploadErrorType.Schema, e.ErrorType));
                Assert.Contains(dataReturnUpload.Errors, p => p.ErrorLevel == Domain.Error.ErrorLevel.Error && p.Description == "Error text1");
                Assert.Contains(dataReturnUpload.Errors, p => p.ErrorLevel == Domain.Error.ErrorLevel.Error && p.Description == "Error text2");
            }
        }
        public async Task HandleAsync_SavesDataUpload()
        {
            // Arrange
            var builder = new ProcessDataReturnXmlFileHandlerBuilder();

            var schemeReturn = new SchemeReturn() { ComplianceYear = "2016", ReturnPeriod = SchemeReturnReturnPeriod.Quarter1JanuaryMarch };
            var xmlGeneratorResult = new GenerateFromDataReturnXmlResult<SchemeReturn>(A.Dummy<string>(),
                schemeReturn, new List<XmlValidationError>());

            A.CallTo(() => builder.XmlGenerator.GenerateDataReturns<SchemeReturn>(A<ProcessDataReturnXmlFile>._))
                .Returns(xmlGeneratorResult);

            A.CallTo(() => builder.DataReturnVersionFromXmlBuilder.Build(A<SchemeReturn>._))
                 .Returns(new DataReturnVersionBuilderResult(A.Dummy<DataReturnVersion>(), A.Dummy<List<ErrorData>>()));

            // Act
            await builder.InvokeHandleAsync();

            // Assert
            A.CallTo(() => builder.DataAccess.AddAndSaveAsync(A<DataReturnUpload>._))
                .MustHaveHappened(Repeated.Exactly.Once);
        }
Ejemplo n.º 12
0
        public async Task HandleAsync_SchemaErrors_DoesNotPerformBusinessValidation()
        {
            // Arrange
            var builder = new ProcessDataReturnXmlFileHandlerBuilder();

            var schemeReturn = new SchemeReturn()
            {
                ComplianceYear = "2016", ReturnPeriod = SchemeReturnReturnPeriod.Quarter1JanuaryMarch
            };
            var xmlGeneratorResult = new GenerateFromDataReturnXmlResult <SchemeReturn>(A.Dummy <string>(),
                                                                                        schemeReturn, new List <XmlValidationError> {
                new XmlValidationError(Core.Shared.ErrorLevel.Error, XmlErrorType.Schema, "Test")
            });

            A.CallTo(() => builder.XmlGenerator.GenerateDataReturns <SchemeReturn>(A <ProcessDataReturnXmlFile> ._))
            .Returns(xmlGeneratorResult);

            // Act
            await builder.InvokeHandleAsync();

            // Assert
            A.CallTo(() => builder.DataReturnVersionFromXmlBuilder.Build(A <SchemeReturn> ._)).MustNotHaveHappened();
        }
Ejemplo n.º 13
0
        public async Task HandleAsync_XmlContainsSchemaError_StoresAvailableDataReturnData()
        {
            using (DatabaseWrapper database = new DatabaseWrapper())
            {
                // Arrange
                ModelHelper  helper       = new ModelHelper(database.Model);
                DomainHelper domainHelper = new DomainHelper(database.WeeeContext);

                var organisation = helper.CreateOrganisation();
                var scheme       = helper.CreateScheme(organisation);

                database.Model.SaveChanges();

                var builder = new ProcessDataReturnXmlFileHandlerBuilder(database.WeeeContext);

                var xmlGeneratorResult = new GenerateFromDataReturnXmlResult <SchemeReturn>(
                    "Test XML string",
                    A.Dummy <SchemeReturn>(),
                    new List <XmlValidationError> {
                    new XmlValidationError(ErrorLevel.Error, XmlErrorType.Schema, "Error text")
                });

                A.CallTo(() => builder.XmlGenerator.GenerateDataReturns <SchemeReturn>(A <ProcessDataReturnXmlFile> ._))
                .Returns(xmlGeneratorResult);

                // Act
                var dataReturnUploadId = await builder.InvokeHandleAsync(organisation.Id, fileName : "XML file name");

                // Assert
                var dataReturnUpload = domainHelper.GetDataReturnUpload(dataReturnUploadId);

                Assert.Equal(scheme.Id, dataReturnUpload.Scheme.Id);
                Assert.Equal("Test XML string", dataReturnUpload.RawData.Data);
                Assert.Equal("XML file name", dataReturnUpload.FileName);
                Assert.NotEqual(TimeSpan.Zero, dataReturnUpload.ProcessTime);
            }
        }
        public async Task HandleAsync_XmlDoesNotContainSchemaError_StoresAvailableDataReturnData()
        {
            using (DatabaseWrapper database = new DatabaseWrapper())
            {
                // Arrange
                ModelHelper helper = new ModelHelper(database.Model);
                DomainHelper domainHelper = new DomainHelper(database.WeeeContext);

                var organisation = helper.CreateOrganisation();
                var scheme = helper.CreateScheme(organisation);
                var dataReturnVersion = helper.CreateDataReturnVersion(scheme, 2016, 3, false);

                database.Model.SaveChanges();

                var builder = new ProcessDataReturnXmlFileHandlerBuilder(database.WeeeContext);

                var schemeReturn = new SchemeReturn()
                {
                    ComplianceYear = "2016",
                    ReturnPeriod = SchemeReturnReturnPeriod.Quarter3JulySeptember
                };

                var xmlGeneratorResult = new GenerateFromDataReturnXmlResult<SchemeReturn>(
                    "Test XML string",
                    schemeReturn,
                    new List<XmlValidationError>());

                A.CallTo(() => builder.XmlGenerator.GenerateDataReturns<SchemeReturn>(A<ProcessDataReturnXmlFile>._))
                     .Returns(xmlGeneratorResult);

                var dbDataReturnVersion = domainHelper.GetDataReturnVersion(dataReturnVersion.Id);
                var dataReturnVersionBuilderResult = new DataReturnVersionBuilderResult(dbDataReturnVersion, A.Dummy<List<ErrorData>>());

                A.CallTo(() => builder.DataReturnVersionFromXmlBuilder.Build(A<SchemeReturn>._))
                    .Returns(dataReturnVersionBuilderResult);

                // Act
                var dataReturnUploadId = await builder.InvokeHandleAsync(organisation.Id, fileName: "XML file name");

                // Assert
                var dataReturnUpload = domainHelper.GetDataReturnUpload(dataReturnUploadId);

                Assert.Equal(scheme.Id, dataReturnUpload.Scheme.Id);
                Assert.Equal("Test XML string", dataReturnUpload.RawData.Data);
                Assert.Equal("XML file name", dataReturnUpload.FileName);
                Assert.Equal(2016, dataReturnUpload.ComplianceYear);
                Assert.Equal(Convert.ToInt32(QuarterType.Q3), dataReturnUpload.Quarter);
                Assert.NotEqual(TimeSpan.Zero, dataReturnUpload.ProcessTime);
            }
        }
        public async Task HandleAsync_XmlContainsError_DoesNotReturnVersionForDataUpload()
        {
            using (DatabaseWrapper database = new DatabaseWrapper())
            {
                // Arrange
                ModelHelper helper = new ModelHelper(database.Model);
                DomainHelper domainHelper = new DomainHelper(database.WeeeContext);

                var organisation = helper.CreateOrganisation();
                var scheme = helper.CreateScheme(organisation);
                var dataReturnVersion = helper.CreateDataReturnVersion(scheme, 2016, 3, false);

                database.Model.SaveChanges();

                var builder = new ProcessDataReturnXmlFileHandlerBuilder(database.WeeeContext);

                var schemeReturn = new SchemeReturn()
                {
                    ComplianceYear = "2016",
                    ReturnPeriod = SchemeReturnReturnPeriod.Quarter3JulySeptember
                };

                var xmlGeneratorResult = new GenerateFromDataReturnXmlResult<SchemeReturn>(
                    "Test XML string",
                    schemeReturn,
                    new List<XmlValidationError>());

                A.CallTo(() => builder.XmlGenerator.GenerateDataReturns<SchemeReturn>(A<ProcessDataReturnXmlFile>._))
                     .Returns(xmlGeneratorResult);

                var dbDataReturnVersion = domainHelper.GetDataReturnVersion(dataReturnVersion.Id);
                var businessErrorAndWarning = new List<ErrorData>
                {
                    new ErrorData("Error text", ErrorLevel.Error)
                };

                var dataReturnVersionBuilderResult = new DataReturnVersionBuilderResult(dbDataReturnVersion, businessErrorAndWarning);

                A.CallTo(() => builder.DataReturnVersionFromXmlBuilder.Build(A<SchemeReturn>._))
                    .Returns(dataReturnVersionBuilderResult);

                // Act
                var dataReturnUploadId = await builder.InvokeHandleAsync(organisation.Id);

                // Assert
                var dataReturnUpload = domainHelper.GetDataReturnUpload(dataReturnUploadId);

                Assert.Null(dataReturnUpload.DataReturnVersion);
            }
        }
        public async Task HandleAsync_XmlContainsSchemaError_StoresSchemaErrors()
        {
            using (DatabaseWrapper database = new DatabaseWrapper())
            {
                // Arrange
                ModelHelper helper = new ModelHelper(database.Model);
                DomainHelper domainHelper = new DomainHelper(database.WeeeContext);

                var organisation = helper.CreateOrganisation();
                var scheme = helper.CreateScheme(organisation);

                database.Model.SaveChanges();

                var builder = new ProcessDataReturnXmlFileHandlerBuilder(database.WeeeContext);

                var xmlGeneratorResult = new GenerateFromDataReturnXmlResult<SchemeReturn>(
                    "Test XML string",
                    A.Dummy<SchemeReturn>(),
                    new List<XmlValidationError>
                    {
                        new XmlValidationError(ErrorLevel.Error, XmlErrorType.Schema, "Error text1"),
                        new XmlValidationError(ErrorLevel.Error, XmlErrorType.Schema, "Error text2")
                    });

                A.CallTo(() => builder.XmlGenerator.GenerateDataReturns<SchemeReturn>(A<ProcessDataReturnXmlFile>._))
                     .Returns(xmlGeneratorResult);

                // Act
                var dataReturnUploadId = await builder.InvokeHandleAsync(organisation.Id);

                // Assert
                var dataReturnUpload = domainHelper.GetDataReturnUpload(dataReturnUploadId);

                Assert.Equal(2, dataReturnUpload.Errors.Count);
                Assert.All(dataReturnUpload.Errors, e => Assert.Equal(Domain.Error.UploadErrorType.Schema, e.ErrorType));
                Assert.Contains(dataReturnUpload.Errors, p => p.ErrorLevel == Domain.Error.ErrorLevel.Error && p.Description == "Error text1");
                Assert.Contains(dataReturnUpload.Errors, p => p.ErrorLevel == Domain.Error.ErrorLevel.Error && p.Description == "Error text2");
            }
        }