예제 #1
0
파일: UnitTest1.cs 프로젝트: Robooto/AMC
        public void WriteToFileTest()
        {
            // Arrange
            var changedItems = new List<ILoggable>();

            var customer = new Customer(1)
            {
                EmailAddress = "*****@*****.**",
                FirstName = "Frodo",
                LastName = "Baggins",
                AddressList = null
            };
            changedItems.Add((ILoggable) customer);

            var product = new Product(2)
            {
                ProductName = "Rake",
                ProductDescription = "Garden Rake with Steel Head",
                CurrentPrice = 6M
            };
            changedItems.Add((ILoggable) product);

            // Act
            LoggingService.WriteToFile(changedItems);

            //Assert

            //Nothing here to assert
        }
예제 #2
0
        public Product Retrieve(int productid)
        {
            var product = new Product(productid);

            if (productid == 2)
            {
                product.ProductName = "Sunflowers";
                product.ProductDescription = "Assorted ";
                product.CurrentPrice = 15.96M;
            }
            return product;
        }
예제 #3
0
        public bool Save(Product product)
        {
            var success = true;

            if (product.HasChanges && product.IsValid)
            {
                if (product.IsNew)
                {
                    // call an insert stored proc
                    //Pizza
                }
                else
                {
                    // Call an update stored proc
                }
            }
            return success;
        }