Exemplo n.º 1
0
        public void Price_Copy()
        {
            double amount = 100;
            Price  p      = new Price(amount, Currency.USD);
            Price  pCopy  = p.Copy();

            pCopy.Amount += amount;
            Assert.AreEqual(amount, pCopy.Amount - p.Amount);
        }
Exemplo n.º 2
0
        public void Put(Guid id, [FromBody] Price value)
        {
            Price price = _repository.Find(id);

            if (price != null)
            {
                price.Copy(value);
                _repository.Update(price);
                _repository.SaveAll();
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Test methods exposed by the EntityHelper class.
        /// </summary>
        private void Step_20_TestEntityHelper_Generated()
        {
            using (TransactionManager tm = CreateTransaction())
            {
                mock = CreateMockInstance(tm);

                Price entity = mock.Copy() as Price;
                entity = (Price)mock.Clone();
                Assert.IsTrue(Price.ValueEquals(entity, mock), "Clone is not working");
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Копирование объекта места
        /// </summary>
        /// <returns>Копия места</returns>
        public Seat DeepCopy()
        {
            var result = new Seat();

            result.Type            = Type;
            result.RFISC           = RFISC;
            result.Number          = Number;
            result.IsFree          = IsFree;
            result.NotExists       = NotExists;
            result.Characteristics = Characteristics;
            result.Price           = Price?.Copy();

            return(result);
        }