public void Can_Update_Quotation()
        {
            var objectGuid = new Guid();
            var quotation  = CreateFakeQuotationObject();

            objectGuid = quotation.Guid;

            nHibernateUniversalRepositoryQuotation.Create(quotation);
            var addedObject = nHibernateUniversalRepositoryQuotation.GetByGuid(objectGuid);

            addedObject.Modifier = 2;
            nHibernateUniversalRepositoryQuotation.Update(addedObject);
            var modifiedObject = nHibernateUniversalRepositoryQuotation.GetByGuid(objectGuid);

            Assert.AreEqual(modifiedObject.Modifier, 2);
            Assert.AreEqual(addedObject.Id, modifiedObject.Id);
            //  Assert.AreNotEqual(addedObject.Modified, modifiedObject.Modified);
            Assert.AreEqual(addedObject.Region, modifiedObject.Region);
            Assert.AreEqual(addedObject.Guid, modifiedObject.Guid);
            Assert.AreEqual(addedObject.Fuel, modifiedObject.Fuel);
            Assert.AreEqual(addedObject.Creator, modifiedObject.Creator);
            Assert.AreEqual(addedObject.Created, modifiedObject.Created);
            Assert.AreEqual(addedObject.Company, modifiedObject.Company);
            Assert.AreEqual(addedObject.Code, modifiedObject.Code);
            nHibernateUniversalRepositoryQuotation.DeleteByGuid(objectGuid);
        }
        public void Can_Update_PriceList()
        {
            var objectGuid = new Guid();
            var priceList  = CreateFakePriceListObject();

            objectGuid = priceList.Guid;

            nHibernateUniversalRepositoryPriceLists.Create(priceList);
            var addedObject = nHibernateUniversalRepositoryPriceLists.GetByGuid(objectGuid);

            addedObject.Modifier = 2;
            nHibernateUniversalRepositoryPriceLists.Update(addedObject);
            var modifiedObject = nHibernateUniversalRepositoryPriceLists.GetByGuid(objectGuid);

            Assert.AreEqual(modifiedObject.Modifier, 2);
            Assert.AreEqual(addedObject.Id, modifiedObject.Id);
            // Assert.AreNotEqual(addedObject.Modified, modifiedObject.Modified);
            Assert.AreEqual(addedObject.Guid, modifiedObject.Guid);
            Assert.AreEqual(addedObject.Creator, modifiedObject.Creator);
            Assert.AreEqual(addedObject.Created, modifiedObject.Created);
            Assert.AreEqual(addedObject.Code, modifiedObject.Code);
            Assert.AreEqual(addedObject.PriceMin, modifiedObject.PriceMin);
            Assert.AreEqual(addedObject.PriceMax, modifiedObject.PriceMax);
            Assert.AreEqual(addedObject.Unit, modifiedObject.Unit);
            Assert.AreEqual(addedObject.Currency, modifiedObject.Currency);
            Assert.AreEqual(addedObject.DateOfQuotation, modifiedObject.DateOfQuotation);
            Assert.AreEqual(addedObject.DateTo, modifiedObject.DateTo);
            nHibernateUniversalRepositoryPriceLists.DeleteById(priceList.Id);
        }
Exemplo n.º 3
0
        public void can_update_document()
        {
            documentsRepository.Create(fakeDocument);
            var addedDocument = documentsRepository.GetById(fakeDocument.Id);

            addedDocument.Link = "D:/";
            documentsRepository.Update(addedDocument);

            var updatedDocument = documentsRepository.GetById(fakeDocument.Id);

            Assert.AreEqual(updatedDocument.Guid, addedDocument.Guid);
            Assert.AreEqual(updatedDocument.Code, addedDocument.Code);
            Assert.AreEqual(updatedDocument.Created, addedDocument.Created);
            Assert.AreEqual(updatedDocument.Link, "D:/");
            Assert.AreEqual(updatedDocument.Creator, addedDocument.Creator);
            //  Assert.AreNotEqual(updatedDocument.Modified, addedDocument.Modified);

            documentsRepository.DeleteById(fakeDocument.Id);
        }