Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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");
        }
Exemplo n.º 6
0
 public void Initialize()
 {
     //New instance of Product Class
     _productClass = new ProductClass();
 }
Exemplo n.º 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");
 }