Ejemplo n.º 1
0
        public async Task <CoinBuy> Update(CoinBuy contract)
        {
            var entity = ContractToEntity(contract);

            entity = await _cbRepo.Update(entity);

            return(EntityToContract(entity));
        }
        public void UpdateOne_Test()
        {
            var id          = 1;
            var newProperty = 3900.00M;
            var entity      = _repo.GetOne(id).Result;

            Assert.NotNull(entity);
            Assert.Equal(id, entity.Id);

            entity.Price = newProperty;

            var updatedEntity = _repo.Update(entity).Result;

            Assert.Equal(entity.Price, updatedEntity.Price);

            var entityFetch = _repo.GetOne(id).Result;

            Assert.NotNull(entityFetch);
            Assert.Equal(id, entityFetch.Id);
            Assert.Equal(newProperty, entityFetch.Price);
        }