public void Get_should_return_invoice() { // Hardcoded invoice var actual = testSubject.Get("1"); // Assert Assert.NotNull(actual); }
public IHttpActionResult Get(int id) { var user = InvoiceRepo.Get(id); if (user == null) { return(StatusCode(HttpStatusCode.NoContent)); } return(Ok(InvoiceRepo.Get(id))); }
public Invoice Get(int id) { var invoice = _repository.Get(id); if (invoice != null) { return(invoice); } else { throw new ObjectNotFoundException($"Not found an invoice with Id {id}"); } }
public void Get_Success_ReturnEntity() { // Arrange var repository = new InvoiceRepository(); var input = repository.Create(GenerateInput()); // Act var result = repository.Get(input.Id); // Assert Assert.IsInstanceOf <Invoice>(result); }
// GET: Invoicing/Invoices/Edit/5 public ActionResult Edit(string id) { try { var objectId = ObjectId.Parse(id); var invoice = repository.Get(objectId); return(View(invoice)); } catch { return(null); } }
public ActionResult Service(int invoiceId) { var lineItem = new InvoiceItem(); var repo = new InvoiceRepository(); lineItem.Service = new ServiceRepository().Get(1); lineItem.Invoice = repo.Get(invoiceId); lineItem.IsActive = true; repo.AddLineItem(lineItem); return(View(lineItem)); }
public void Delete_Success_ReturnNull() { // Arrange var repository = new InvoiceRepository(); var input = repository.Create(GenerateInput()); // Act repository.Delete(input.Id); var result = repository.Get(input.Id); // Assert Assert.IsNull(result); }
public ActionResult GetDetailsFormPartialView(int id) { return(PartialView("_DetailsFormPartialView", _repository.Get(id))); }
public async Task GIVEN_no_invoice_with_id_WHEN_Get_THEN_throws(Guid invoiceId) { A.CallTo(() => _dbContext.Invoices).Returns(ContainerFactory.FakeContainer(new InvoiceState[0])); await Assert.ThrowsAsync <AggregateNotFoundException <Invoice> >(() => _sut.Get(invoiceId)); }
public Invoice Id(int invoiceId) { return(_repository.Get(invoiceId)); }
public ActionResult GetModificationPartialView(int id) { return(PartialView("_ModificationPartialView", _repository.Get(id))); }