Beispiel #1
0
 public void FormatExceptionTest()
 {
     string stateCode = "Alabama";
     string zip = "9852ddfd";
     GetAllProducts g = new GetAllProducts();
     ProductClass pc = new ProductClass();
     List<ProductClass> p = g.GetEnterpriseProducts(stateCode,Int32.Parse(zip));
     p.Add(pc);
 }
Beispiel #2
0
 public void FormatExceptionTest()
 {
     string rate = "this is rate!!!";
     GetAllProducts g = new GetAllProducts();
     ProductClass pc=new ProductClass();
     pc.Rate = Convert.ToDecimal(rate);
     List<ProductClass> p = g.GetAllProductsList();
     p.Add(pc);
 }
Beispiel #3
0
        public void FormatExceptionTest()
        {
            string              stateCode = "Alabama";
            string              zip       = "9852ddfd";
            GetAllProducts      g         = new GetAllProducts();
            ProductClass        pc        = new ProductClass();
            List <ProductClass> p         = g.GetEnterpriseProducts(stateCode, Int32.Parse(zip));

            p.Add(pc);
        }
Beispiel #4
0
        public void FormatExceptionTest()
        {
            string         rate = "this is rate!!!";
            GetAllProducts g    = new GetAllProducts();
            ProductClass   pc   = new ProductClass();

            pc.Rate = Convert.ToDecimal(rate);
            List <ProductClass> p = g.GetAllProductsList();

            p.Add(pc);
        }
Beispiel #5
0
        //[ExpectedException(typeof(FormatException))]
        public void FormatExceptionTest()
        {
            FormatException fe = null;

            try
            {
                string         rate = "A string can't be a rate!";
                GetAllProducts g    = new GetAllProducts();
                ProductClass   pc   = new ProductClass();
                pc.Rate = Convert.ToDecimal(rate);
                List <ProductClass> p = g.GetAllProductsList();
                p.Add(pc);
            }
            catch (FormatException f)
            {
                fe = f;
            }
            Assert.IsNotNull(fe, "Expected to throw Format Exception");
        }
Beispiel #6
0
 public void Initialize()
 {
     //New instance of Product Class
     _productClass = new ProductClass();
 }
Beispiel #7
0
 public void FormatExceptionTest()
 {
     FormatException fe=null;
     try
     {
         string rate = "A string can't be a rate!";
         GetAllProducts g = new GetAllProducts();
         ProductClass pc = new ProductClass();
         pc.Rate = Convert.ToDecimal(rate);
         List<ProductClass> p = g.GetAllProductsList();
         p.Add(pc);
     }
     catch (FormatException f)
     {
         fe = f;
     }
     Assert.IsNotNull(fe,"Expected to throw Format Exception");
 }