public void GetNumberOfWarrantyOrderByInvoiceIdAndProductId_Success_ReturnInt() { // Arrange var repository = new WarrantyOrderRepository(); // Act var result = repository.GetNumberOfWarrantyOrderByInvoiceIdAndProductId(1, 1); // Assert Assert.That(result >= 0); }
public void Get_Fail_ReturnNull() { // Arrange var repository = new WarrantyOrderRepository(); // Act var result = repository.Get(111_111_111); // Assert Assert.IsNull(result); }
public void Create_Success_ReturnEntity() { // Arrange var repository = new WarrantyOrderRepository(); var input = GenerateInput(); // Act var result = repository.Create(input); // Assert Assert.That(CompareProperties(input, result)); }
public void Get_Success_ReturnEntity() { // Arrange var repository = new WarrantyOrderRepository(); var input = repository.Create(GenerateInput()); // Act var result = repository.Get(input.Id); // Assert Assert.IsInstanceOf <WarrantyOrder>(result); }
public void Update_Success_ReturnFalse() { // Arrange var repository = new WarrantyOrderRepository(); var input = GenerateInput(generateId: true); // Act var result = repository.Update(input); // Assert Assert.IsFalse(result); }
public void Delete_Success_ReturnNull() { // Arrange var repository = new WarrantyOrderRepository(); var input = repository.Create(GenerateInput()); // Act repository.Delete(input.Id); var result = repository.Get(input.Id); // Assert Assert.IsNull(result); }
public void Update_Success_ReturnTrue() { // Arrange var repository = new WarrantyOrderRepository(); var input = repository.Create(GenerateInput()); var inputForUpdate = GenerateInput(id: input.Id); // Act var result = repository.Update(inputForUpdate); // Assert Assert.IsTrue(result); }
public void GetAllWithStatusFilter_Success_ReturnEntities() { // Arrange var repository = new WarrantyOrderRepository(); var filter = new List <WarrantyOrderStatus>() { WarrantyOrderStatus.WaitForSent, WarrantyOrderStatus.Sent, WarrantyOrderStatus.WaitForCustomer, WarrantyOrderStatus.Done, }; // Act var result = repository.GetAllWithStatusFilter(filter); // Assert Assert.IsInstanceOf <IEnumerable <WarrantyOrder> >(result); }
public WarrantyService() { _invoiceProductRepository = new InvoiceProductRepository(); _warrantyOrderRepository = new WarrantyOrderRepository(); }