public static User GetFakeUserWithData() { User user = new Model.User("test", "*****@*****.**", "test"); user.Categories.Add(new Category("Transport")); user.Categories.Add(new Category("Ecole")); user.Categories.Add(new Category("Alimentation")); user.Categories.Add(new Category("Maison")); user.Categories.Add(new Category("Vetement")); for (int i = 0; i < 5; i++) { Model.Account account = new Model.Account($"Compte{i}", 1000); Due fakeDue = new Due($"Echeance{i}", (i % 2 == 0) ? operationType.Credit : operationType.Debit, i, paymentType.Cash, i * 2000, user.Categories.ElementAt(i % 5)); for (int j = 0; j < 30; j++) { Operation fakeOperation = new Operation($"Operation{j}", (j % 2 == 0) ? operationType.Credit : operationType.Debit, DateTime.Now, paymentType.Cash, 3000, user.Categories.ElementAt(i % 5)); account.Operations.Add(fakeOperation); } account.Dues.Add(fakeDue); user.Accounts.Add(account); } return(user); }
public static void CreateFakeAccount() { for (int i = 0; i < 5; i++) { Model.Account account = new Model.Account($"Compte{i}", 1000); Program.currentLoggedUser.Accounts.Add(account); } }