Exemple #1
0
        public void TestAlreadyExists()
        {
            IProductUpdator productUpdator = MefBase.Resolve <IProductUpdator>();
            var             product        = JsonConvert.DeserializeObject <Product>("{Id: '1'}");

            productUpdator.Create(product);
        }
Exemple #2
0
        public void ProductValidation_UpdateException()
        {
            IProductUpdator productUpdator = MefBase.Resolve <IProductUpdator>();
            Product         product        = JsonConvert.DeserializeObject <Product>("{ProductCategoryId: 1, Name: \"Tennis Shoes\", Id: ''}");

            productUpdator.Update(product);
        }
Exemple #3
0
        public void TestInvalidIdException4()
        {
            IProductUpdator productUpdator = MefBase.Resolve <IProductUpdator>();
            var             product        = JsonConvert.DeserializeObject <Product>("{Id: '" + Guid.Empty + "'}");

            productUpdator.Create(product);
        }
        public void ProductValidation_Category()
        {
            IProductUpdator productUpdator = MefBase.Resolve <IProductUpdator>();
            Product         product        = JsonConvert.DeserializeObject <Product>("{Name: \"Tennis Shoes\", Id: \"1234\"}");

            productUpdator.Create(product);
        }
        public void ProductValidation_Name()
        {
            IProductUpdator productUpdator = MefBase.Resolve <IProductUpdator>();
            Product         product        = JsonConvert.DeserializeObject <Product>("{ProductCategoryId: 1, Id: \"1234\"}");

            productUpdator.Create(product);
        }
        public void DeleteTest()
        {
            IProductUpdator  productUpdator  = MefBase.Resolve <IProductUpdator>();
            IProductSelector productSelector = MefBase.Resolve <IProductSelector>();

            Assert.IsTrue(productSelector.FindAll(true).Count == 15);
            productUpdator.Delete("5");
            Assert.IsTrue(productSelector.FindAll(true).Count == 14);
        }
        public void UpdateTest()
        {
            IProductUpdator  productUpdator  = MefBase.Resolve <IProductUpdator>();
            IProductSelector productSelector = MefBase.Resolve <IProductSelector>();
            Product          product         = productSelector.Get("4");

            Assert.IsTrue(product.Description == "With roots that extend all the way back to the Wilson Ultra and legendary Pro Staff 6.0 85, the Pro Staff 90 is a true classic. This one is built for advanced players in search of incredible feel, rock solid stability and surgical precision. Featuring the ultimate player's specs, the Pro Staff 90 includes a 12+ oz weight, headlight balance, thin beam, leather grip and Wilson's tried and true Graphite/Kevlar Layup. It also has Amplifeel Technology in the handle to filter out some of the harsher vibrations. All told these ingredients add up to an unmatched level of feel, precision and plow-through. From the baseline the control on full swings is simply amazing, as is the unmistakably sublime feel when contact is cleanly made. There's also some penetrating power available to those who can get the mass moving. At net the Pro Staff 90 provides remarkable stability and pinpoint accuracy, with enough weight to punch the ball deep. All in all, this venerable racquet is simply a great option for any serious player who wants to experience the ultimate in precision and stability along with that timeless Pro Staff feel.");
            Assert.IsTrue(product.Name == "Wilson Pro Staff 90");
            Assert.IsTrue(product.ProductCategoryId == 1);

            product.Description       = "Updated Description";
            product.Name              = "Updated Name";
            product.ProductCategoryId = 1;

            productUpdator.Update(product);
            product = productSelector.Get("4");

            Assert.IsTrue(product.Description == "Updated Description");
            Assert.IsTrue(product.Name == "Updated Name");
            Assert.IsTrue(product.LastModifiedBy == "jsucupira");
        }
Exemple #8
0
        public void TestDeleteException3()
        {
            IProductUpdator productUpdator = MefBase.Resolve <IProductUpdator>();

            productUpdator.Delete("0");
        }
Exemple #9
0
        public void TestNullException()
        {
            IProductUpdator productUpdator = MefBase.Resolve <IProductUpdator>();

            productUpdator.Create(null);
        }
Exemple #10
0
        public void ProductValidation_UpdateException2()
        {
            IProductUpdator productUpdator = MefBase.Resolve <IProductUpdator>();

            productUpdator.Update(null);
        }
Exemple #11
0
        public void TestDeleteException4()
        {
            IProductUpdator productUpdator = MefBase.Resolve <IProductUpdator>();

            productUpdator.Delete(Guid.Empty.ToString());
        }