public FullDocument CreateTestDocument(Supplier supplier, Client client, DocumentReceiveLog documentLogEntity) { var document = new FullDocument { ClientCode = client.Id, DocumentDate = DateTime.Now.AddDays(-1), Supplier = supplier, ProviderDocumentId = "123", Log = documentLogEntity, AddressId = null, }; var documentLine = new DocumentLine { Certificates = "Test certificate", Code = "999", Country = "Test country", Nds = 10, Period = "01.10.2010", Producer = "Test producer", ProducerCost = 10.10M, VitallyImportant = true, Document = document, }; document.Lines = new List <DocumentLine> { documentLine }; session.Save(document); return(document); }
public void ShowTest() { var client = DataMother.CreateClientAndUsers(); var user = client.Users.First(); var afUpdate = new UpdateLogEntity(user); var supplier = DataMother.CreateSupplier(); var document = new FullDocument { Supplier = supplier, ClientCode = client.Id }; var line = document.NewLine(new DocumentLine { Product = "TestCertificateRequestLogProduct" }); var nuSert = new CertificateRequestLog { Line = line, Update = afUpdate }; Save(afUpdate, supplier, document, nuSert); Open("Main/Stat"); Css("#StatisticsTD a").Click(); AssertText("Статистика по сертификатам"); var otherRegion = session.QueryOver <Region>().List().Last(); Css("#filter_Region_Id").SelectByValue(otherRegion.Id.ToString()); Click("Показать"); Assert.That(browser.Text, !Is.StringContaining("TestCertificateRequestLogProduct")); Css("#filter_Region_Id").SelectByValue(client.MaskRegion.ToString()); Click("Показать"); AssertText("TestCertificateRequestLogProduct"); }
private void PrepareTestDocumentLog() { var catalogName = new TestCatalogName { Name = "testName" }; var catalogForm = new TestCatalogForm { Form = "testForm" }; session.Save(catalogForm); session.Save(catalogName); var documentLog = new FullDocument(_document); var catalog = new Catalog { Name = "testCatalog", NameId = catalogName.Id, FormId = catalogForm.Id }; _product = new Product(catalog); _producer = new Producer { Name = "testProducer" }; session.Save(catalog); session.Save(_product); session.Save(_producer); _line = new DocumentLine { CatalogProducer = _producer, CatalogProduct = _product, Product = "123", Document = documentLog }; documentLog.Lines = new List <DocumentLine>(); documentLog.Lines.Add(_line); session.Save(documentLog); session.Flush(); }
public void Producer_in_document_detalization_for_position() { var catalogName = new TestCatalogName { Name = "testCatName" }; var catalogForm = new TestCatalogForm { Form = "testForm" }; Save(catalogName, catalogForm); document.FileName = "SpecialFileNameForThisReport"; session.Save(document); var documentLog = new FullDocument(document); var catalog = new Catalog { Name = "testCatalog", NameId = catalogName.Id, FormId = catalogForm.Id }; var product = new Product(catalog); var producer = new Producer { Name = "testProducer" }; Save(catalog, producer, product); var line = new DocumentLine { CatalogProducer = producer, CatalogProduct = product, Product = "123", Document = documentLog }; documentLog.Lines = new List <DocumentLine>(); documentLog.Lines.Add(line); session.Save(documentLog); Open("Logs/Documents?filter.Client.Id={0}", client.Id); Click("SpecialFileNameForThisReport"); WaitAjax(); Click("123"); WaitForText("Сопоставлен с"); AssertText("Сопоставлен с \"testCatName testForm\""); AssertText("По производителю с \"testProducer\""); }