コード例 #1
0
            public void SendsBytesThroughDocumentBundleProcessors()
            {
                //Arrange
                var clientConfiguration = new Klientkonfigurasjon(Miljø.FunksjoneltTestmiljø)
                {
                    Dokumentpakkeprosessorer = new List <IDokumentpakkeProsessor>
                    {
                        new SimpleDocumentBundleProcessor(),
                        new SimpleDocumentBundleProcessor()
                    }
                };

                var forsendelse = DomainUtility.GetForsendelseSimple();
                var asiceAttachableProcessors = clientConfiguration.Dokumentpakkeprosessorer.Select(p => new AsiceAttachableProcessor(forsendelse, p));
                var asiceAttachables          = new IAsiceAttachable[] { DomainUtility.GetHoveddokumentSimple() };

                //Act
                var asiceArchive = new AsiceArchive(DomainUtility.GetMottakerCertificate(), new GuidUtility(), asiceAttachableProcessors, asiceAttachables);
                var bytes        = asiceArchive.Bytes;

                //Assert
                foreach (var simpleProcessor in clientConfiguration.Dokumentpakkeprosessorer.Cast <SimpleDocumentBundleProcessor>())
                {
                    Assert.True(simpleProcessor.StreamLength > 1000);
                    Assert.True(simpleProcessor.CouldReadBytesStream);
                    Assert.Equal(0, simpleProcessor.Initialposition);
                }
            }