public TestProductController() { #region load dummy data storeAppContext = new TestDbPOS(); storeAppContext.Products.Add(new Product() { Id = new Guid("223913df-203a-41e2-83a9-94343ee5d434"), Name = "Katana", Description = "its sharp", ProductCategories = new List <ProductCategory>(), Prices = new List <Price>() }); storeAppContext.Products.Add(new Product() { Id = new Guid("5579b911-2392-43f8-87cf-83e1a7bbed6f"), Name = "Hard Mail", Description = "its hard", ProductCategories = new List <ProductCategory>(), Prices = new List <Price>() }); #endregion #region load controller productController = new ProductController(storeAppContext); #endregion }
public TestSaleController() { #region load dummy data storeAppContext = new TestDbPOS(); storeAppContext.Sales.Add(new Sale() { Id = new Guid("3bc4d343-1a0d-432f-a190-d8f76ebb1ab9"), UserId = new Guid("839b0da7-50f7-4af0-98bf-4bd746cfa192"), User = new User() { UserRoles = new List <UserRole>() } }); storeAppContext.Sales.Add(new Sale() { Id = new Guid("ed08a51b-8e08-4e71-8b28-db1ec5ce3d0b"), UserId = new Guid("5b13ea1f-dfb9-4f56-9636-b45a8036d7ca"), User = new User() { UserRoles = new List <UserRole>() } }); #endregion #region load controller saleController = new SaleController(storeAppContext); #endregion }
public TestPurchaseController() { #region load dummy data storeAppContext = new TestDbPOS(); storeAppContext.Purchases.Add(new Purchase() { Id = new Guid("3bc4d343-1a0d-432f-a190-d8f76ebb1ab9"), SupplierId = new Guid("890f2f7c-5442-4c8b-aedf-9baa6839fc78"), UserId = new Guid("839b0da7-50f7-4af0-98bf-4bd746cfa192"), Supplier = new Supplier(), User = new User() { UserRoles = new List <UserRole>() } }); storeAppContext.Purchases.Add(new Purchase() { Id = new Guid("ed08a51b-8e08-4e71-8b28-db1ec5ce3d0b"), SupplierId = new Guid("e349b832-46da-4543-a3eb-9e697f7207e3"), UserId = new Guid("5b13ea1f-dfb9-4f56-9636-b45a8036d7ca"), Supplier = new Supplier(), User = new User() { UserRoles = new List <UserRole>() } }); #endregion #region load controller purchaseController = new PurchaseController(storeAppContext); #endregion }
/* * @description : Constructor class for testing or unit test */ public ProductController(IDbPOS context) { _db = context; productRepository = new ProductRepository(context); productCategoryRepository = new ProductCategoryRepository(context); priceRepository = new PriceRepository(context); }
public TestSupplierController() { #region load dummy storeAppContext = new TestDbPOS(); storeAppContext.Suppliers.Add(new Supplier() { Id = new Guid("bbbf396b-5b78-4924-bd21-a9afa9decfc8"), Name = "PT Santuy Selalu", Address = "Jalan Santuy Blok S", Phone = "0799797979", Description = "Santuy Terus ya" }); storeAppContext.Suppliers.Add(new Supplier() { Id = new Guid("bd12976a-bfdb-436f-b790-618399da434e"), Name = "PT Cucok Bagus", Address = "Jalan Lekong Blok L", Phone = "07970012122", Description = "Lekong ya cik" }); #endregion #region load controller supplierController = new SupplierController(storeAppContext); #endregion }
public TestRoleController() { #region load dummy storeAppContext = new TestDbPOS(); storeAppContext.Roles.Add(new Role() { Id = new Guid("223913df-203a-41e2-83a9-94343ee5d434"), Name = "superuser" }); storeAppContext.Roles.Add(new Role() { Id = new Guid("5579b911-2392-43f8-87cf-83e1a7bbed6f"), Name = "admin" }); #endregion #region load controller roleController = new RoleController(storeAppContext); #endregion }
public TestCategoryController() { #region load dummy data storeAppContext = new TestDbPOS(); storeAppContext.Categories.Add(new Category() { Id = new Guid("fbc41aa2-b12e-4494-99ba-711278de74c7"), Name = "Weapon" }); storeAppContext.Categories.Add(new Category() { Id = new Guid("c3f00ad7-afdb-441e-ab37-ec12dc0fefc5"), Name = "Armor" }); #endregion #region load controller categoryController = new CategoryController(storeAppContext); #endregion }
public TestReceivedProductController() { #region load dummy data storeAppContext = new TestDbPOS(); User user = new User() { Id = new Guid("839b0da7-50f7-4af0-98bf-4bd746cfa192"), Email = "johndoe@mail", Name = "john doe", Gender = GenderEnum.Male, Password = "******", UserRoles = new List <UserRole>() }; storeAppContext.ReceivedProducts.Add(new ReceivedProduct() { Id = new Guid("839b0da7-50f7-4af0-98bf-4bd746cfa192"), ProductDetailID = new Guid("3bc4d343-1a0d-432f-a190-d8f76ebb1ab9"), UserId = new Guid("839b0da7-50f7-4af0-98bf-4bd746cfa192"), Quantity = 10, User = user, ProductDetail = new ProductDetail() }); storeAppContext.ReceivedProducts.Add(new ReceivedProduct() { Id = new Guid("5b13ea1f-dfb9-4f56-9636-b45a8036d7ca"), ProductDetailID = new Guid("ed08a51b-8e08-4e71-8b28-db1ec5ce3d0b"), UserId = new Guid("5b13ea1f-dfb9-4f56-9636-b45a8036d7ca"), Quantity = 10, User = new User() { Id = new Guid("5b13ea1f-dfb9-4f56-9636-b45a8036d7ca"), UserRoles = new List <UserRole>() }, ProductDetail = new ProductDetail() }); #endregion #region load controller receivedProductController = new ReceivedProductController(storeAppContext, user); #endregion }
public SupplierRepository(IDbPOS db) { _db = db; }
public RoleRepository(IDbPOS db) { _db = db; }
public TestUserController() { storeAppContext = new TestDbPOS(); #region load dummy data UserToken userTokenObj = new UserToken() { UserId = new Guid("c3f00ad7-afdb-441e-ab37-ec12dc0fefc5"), Token = userToken, DeviceNumber = "PTX123" }; User userDataLogin = new User() { Id = new Guid("c3f00ad7-afdb-441e-ab37-ec12dc0fefc5"), Email = "superuser@su", Password = "******", Name = "superuser", Phone = "000000000", Gender = GenderEnum.Male, UserRoles = new List <UserRole>() { new UserRole() { UserId = new Guid("c3f00ad7-afdb-441e-ab37-ec12dc0fefc5"), RoleId = new Guid("34163b07-0cf8-49d4-893a-9ffe20496d3d"), Role = new Role() { Id = new Guid("34163b07-0cf8-49d4-893a-9ffe20496d3d"), Name = "superuser" } } }, UserTokens = new List <UserToken>() { userTokenObj } }; storeAppContext.Users.Add(userDataLogin); storeAppContext.Users.Add(new User() { Id = new Guid("fbc41aa2-b12e-4494-99ba-711278de74c7"), Email = "johndoe@mail", Password = "******", Name = "john doe", Phone = "12345678", Gender = GenderEnum.Male, UserRoles = new List <UserRole>() { new UserRole() { UserId = new Guid("c3f00ad7-afdb-441e-ab37-ec12dc0fefc5"), RoleId = new Guid("0709bfc4-5e9e-436f-a5ee-dd93162633b4"), Role = new Role() { Id = new Guid("0709bfc4-5e9e-436f-a5ee-dd93162633b4"), Name = "Customer" } } } }); storeAppContext.UserTokens.Add(userTokenObj); #endregion #region Load Controller userController = new UserController(storeAppContext, userDataLogin); #endregion }
/* * @description : Constructor class for testing or unit test */ public CategoryController(IDbPOS context) { _db = context; categoryRepository = new CategoryRepository(context); }
/* * @description : Constructor class for testing or unit test */ public ReceivedProductController(IDbPOS context, User user) { userDataLogin = new UserViewModel(user); receivedProductRepository = new ReceivedProductRepository(context); }
public ProductCategoryRepository(IDbPOS db) { _db = db; }
/* * @description : Constructor class for testing or unit test */ public UserController(IDbPOS context, User user) { _db = context; userRepository = new UserRepository(_db); userDataLogin = new UserViewModel(user); }
public PriceRepository(IDbPOS db) { _db = db; }
public ReceivedProductRepository(IDbPOS db) { _db = db; }
public UserRepository(IDbPOS db) { _db = db; }
/* * @description : Constructor class for testing or unit test */ public PurchaseController(IDbPOS context) { purchaseRepository = new PurchaseRepository(context); }
/* * @description : Constructor class for testing or unit test */ public RoleController(IDbPOS context) { _db = context; roleRepository = new RoleRepository(context); }
public PurchaseRepository(IDbPOS db) { _db = db; }
public ProductRepository(IDbPOS db) { _db = db; }
/* * @description : Constructor class for testing or unit test */ public SaleController(IDbPOS context) { saleRepository = new SaleRepository(context); }
/* * @description : Constructor class for testing or unit test */ public SupplierController(IDbPOS context) { _db = context; supplierRepository = new SupplierRepository(context); }
public CategoryRepository(IDbPOS db) { _db = db; }