/// <summary> /// Default constructor, sets the ProductDTO represented by this TransactionItem /// </summary> /// <param name="item">the ProductDTO this object will represent</param> public TransactionItem(ProductDTO item) { Item = new ObservableProduct(item); }
public void Initialize() { mockProduct = new Mock<IProductService>(); mockProduct.Setup(x => x.GetAllProducts()).Returns(new List<ProductDTO>() { new ProductDTO() { UPC = "123", BrandID = 1, CategoryListID = 1, Description = "Test", IsTaxable = true, HasDeposit = true, MinimumAge = 1, Name = "Test Item", MinOnHand = 0, OnHand = 1, SellingPrice = 1, StoreCost = 2, } }); mockBrand = new Mock<IBrandService>(); mockBrand.Setup(x => x.GetAllBrands()).Returns(new List<BrandDTO>() { new BrandDTO() { Id = 1, Name = "Test1" }, new BrandDTO() { Id = 2, Name = "Test2" } }); mockCategory = new Mock<ICategoryService>(); mockCategory.Setup(x => x.GetAll()).Returns(new List<CategoryDTO>() { new CategoryDTO() { Id = 1, Name = "Test Category", Description = "A test category" }, }); testProduct = new ObservableProduct(new ProductDTO { UPC = "555", BrandID = 1, CategoryListID = 1, Description = "Test", IsTaxable = true, HasDeposit = true, MinimumAge = 1, Name = "Test Item", MinOnHand = 0, OnHand = 1, SellingPrice = 1, StoreCost = 2 }); viewModel = new InventoryViewModel(mockProduct.Object, mockBrand.Object, mockCategory.Object); }