Exemple #1
0
        private void Create_loaded_document_logs_unparsed_document(out Client client, out Supplier supplier,
                                                                   out DocumentReceiveLog documentLogEntity, out UpdateLogEntity updateLogEntity)
        {
            client   = DataMother.CreateTestClientWithAddressAndUser();
            supplier = DataMother.CreateSupplier();
            Save(supplier);
            documentLogEntity = DataMother.CreateTestDocumentLog(supplier, client);
            updateLogEntity   = DataMother.CreateTestUpdateLogEntity(client);

            session.SaveOrUpdate(updateLogEntity);
            documentLogEntity.SendUpdateLogEntity = updateLogEntity;
            Save(documentLogEntity);
        }
        public void Setup()
        {
            testClient = DataMother.CreateTestClientWithAddressAndUser();

            var user = testClient.Users.First();

            user.AvaliableAddresses.Add(testClient.Addresses.First());
            session.Save(user);
            testSupplier = DataMother.CreateSupplier();
            session.Save(testSupplier);
            var order = new ClientOrder(testClient.Users.First(), testSupplier.Prices[0]);

            session.Save(order);

            var product = new Product(session.Load <Catalog>(DataMother.CreateCatelogProduct()));
            var line    = new OrderLine(order, product, 100, 1);

            session.Save(product);
            session.Save(line);

            session.Save(order);
            testSupplier = DataMother.CreateSupplier();
            var documentLogEntity = DataMother.CreateTestDocumentLog(testSupplier, testClient);
            var updateLogEntity   = DataMother.CreateTestUpdateLogEntity(testClient);

            documentLogEntity.DocumentType = DocumentType.Waybill;
            session.SaveOrUpdate(updateLogEntity);
            documentLogEntity.SendUpdateLogEntity = updateLogEntity;
            session.Save(documentLogEntity);

            var document = DataMother.CreateTestDocument(testSupplier, testClient, documentLogEntity);

            session.Save(document);
            session.Flush();

            Open(testClient);
            AssertText("Клиент");
        }