więcej testowych produktów i transakcji

This commit is contained in:
kamil 2024-05-16 22:30:57 +02:00
parent f09289c101
commit 2c4927aa1d

View File

@ -37,9 +37,25 @@ namespace FirmTracker_Server
Type = 1,
Availability = 20
};
var product4 = new nHibernate.Products.Product
{
Name = "Produkt 3",
Description = "produkt",
Price = 25.00m,
Type = 1,
Availability = 10
};
var product5 = new nHibernate.Products.Product
{
Name = "Usługa 2",
Description = "usługa",
Price = 700.00m,
Type = 0,
Availability = 0
};
var transaction1 = new Transaction
{
Date = DateTime.Now,
Date = DateTime.Now.AddDays(-2),
Description = "testowa transakcja",
Discount = 10,
EmployeeId = 1,
@ -47,12 +63,20 @@ namespace FirmTracker_Server
};
var transaction2 = new Transaction
{
Date = DateTime.Now,
Date = DateTime.Now.AddDays(-3),
Description = "testowa transakcja",
Discount = 30,
EmployeeId = 2,
PaymentType = "Gotówka",
};
var transaction3 = new Transaction
{
Date = DateTime.Now,
Description = "testowa transakcja",
Discount = 15,
EmployeeId = 1,
PaymentType = "BLIK",
};
var expense1 = new Expense
{
@ -69,8 +93,11 @@ namespace FirmTracker_Server
productCrud.AddProduct(product);
productCrud.AddProduct(product2);
productCrud.AddProduct(product3);
productCrud.AddProduct(product4);
productCrud.AddProduct(product5);
transactionCrud.AddTransaction(transaction1);
transactionCrud.AddTransaction(transaction2);
transactionCrud.AddTransaction(transaction3);
expenseCrud.AddExpense(expense1);
@ -87,8 +114,8 @@ namespace FirmTracker_Server
List<TransactionProduct> testTransactionProducts2 = new List<TransactionProduct>
{
new TransactionProduct { ProductID = 3, Quantity=4},
new TransactionProduct { ProductID = 1, Quantity=6}
new TransactionProduct { ProductID = 4, Quantity=5},
new TransactionProduct { ProductID = 5, Quantity=1}
};
foreach (var transactionProduct in testTransactionProducts2)
{
@ -96,6 +123,17 @@ namespace FirmTracker_Server
}
List<TransactionProduct> testTransactionProducts3 = new List<TransactionProduct>
{
new TransactionProduct { ProductID = 3, Quantity=12},
new TransactionProduct { ProductID = 2, Quantity=1}
};
foreach (var transactionProduct in testTransactionProducts3)
{
transactionCrud.AddTransactionProductToTransaction(transaction3.Id, transactionProduct);
}
}
catch(Exception ex)