public void SaleSqlRepository_Update_ShouldBeOK() { //Cenario Sale sale = ObjectMother.GetSale(); sale.Product = new Product { Id = 1, Name = "Rice", SalePrice = 6, CostPrice = 2, Disponibility = true, FabricationDate = DateTime.Now, ExpirationDate = DateTime.Now.AddMonths(4) }; sale.Id = 1; //Executa _repository.Update(sale); //Verifica Sale saleEdited = _repository.Get(sale.Id); saleEdited.ClientName.Should().Be(sale.ClientName); }
public void SaleRepository_Get_ShouldBeOk() { _product.Object.Id = 1; _sale = ObjectMother.GetSaleSql(_product.Object); _sale.Id = 1; _expectedSale = _repository.Get(_sale.Id); _expectedSale.Should().NotBeNull(); _expectedSale.Id.Should().Be(_sale.Id); }
public Sale Get(Sale sale) { if (sale.Id <= 0) { throw new InvalidIdException(); } return(_repository.Get(sale.Id)); }
public Sale Get(long id) { if (id < 1) { throw new IdentifierUndefinedException(); } return(_repositorio.Get(id)); }
public Sale Get(int id) { try { return(saleRepository.Get(id)); } catch { throw; } }
public void SaleIntegration_Delete_ShouldBeOk() { _product.Id = 1; _product.Availability = 1; _sale = ObjectMother.GetSaleSql(_product); _sale.Id = 1; _service.Delete(_sale); _expectedSale = _repository.Get(_sale.Id); _expectedSale.Should().BeNull(); }
public async Task <Sale> Get(string id) { return(await saleRepository.Get(id)); }
public Sale Get(int id) { return(_repository.Get(id)); }
public IList <Sale> GetSaleList() { ISaleRepository SaleRepository = _dataFactoryRepository.GetDataRepository <ISaleRepository>(); return(SaleRepository.Get().ToList()); }
public Sale FetchSale(int id) { var sale = _repoSale.Get(id); return(sale); }
public async Task <IEnumerable <Sale> > Get(Expression <Func <Sale, bool> > predicate) { return(await _saleRepository.Get(predicate)); }