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_Delete_PriceList_By_Guid()
        {
            var objectGuid      = new Guid();
            var priceListObject = CreateFakePriceListObject();

            objectGuid = priceListObject.Guid;
            nHibernateUniversalRepositoryPriceLists.Create(priceListObject);

            var addedObject = nHibernateUniversalRepositoryPriceLists.GetByGuid(objectGuid);

            if (addedObject is null)
            {
                throw new Exception("Nie udalo się dodać obiektu, więc nie ma co usuwać");
            }
            else
            {
                nHibernateUniversalRepositoryPriceLists.DeleteByGuid(objectGuid);
                var deletedObject = nHibernateUniversalRepositoryPriceLists.GetByGuid(objectGuid);
                Assert.AreEqual(deletedObject, null);
            }
        }
Exemplo n.º 3
0
 public void can_delete_document_by_guid()
 {
     documentsRepository.Create(fakeDocument);
     documentsRepository.DeleteByGuid(fakeDocument.Guid);
 }