public void GetNotExistingOrderByIdTest()
        {
            DBDAL dbdal = new DBDAL();
            Order order = dbdal.GetById(-345);

            Assert.IsNull(order);
        }
        public void GetAllTest()
        {
            DBDAL dbdal = new DBDAL();

            Order[] allorders = dbdal.GetAll().ToArray();
            Assert.AreNotEqual(allorders.Length, 0);
        }
 public DataSet getSite()
 {
     using (DbCommand objCmd = DBDAL.GetStoredProcCommand("spListAllSite"))
     {
         return(DBDAL.ExecuteDataSet(objCmd));
     }
 }
        public void AddTest()
        {
            DBDAL dbdal  = new DBDAL();
            Order order  = CreateTestOrder();
            int   before = dbdal.GetAll().Count();

            dbdal.Add(order);
            int after = dbdal.GetAll().Count();

            Assert.AreEqual(before + 1, after);
        }
        public void MarkAsDoneWithIncorrectOrderIdTest()
        {
            DBDAL dbdal = new DBDAL();

            try
            {
                dbdal.MarkAsDone(-57, DateTime.Now);
                Assert.Fail("Не было выброшено ниодного исключения.");
            }
            catch (ArgumentException e)
            {
                StringAssert.Contains(e.Message, "Недопустимое значение параметра!");
            }
        }
 public void AddNewOrderWithIncorrectCustomerIDTest()
 {
     DBDAL dbdal = new DBDAL();
     Order order = CreateTestOrder();
     order.CustomerID = "Hello world!!!";
     try
     {
         dbdal.Add(order);
         Assert.Fail("Не было выброшено ниодного исключения.");
     }
     catch (ArgumentException e)
     {
         StringAssert.Contains(e.Message, "Недопустимое значение параметра!");
     }
 }
        public void AddNewOrderWithIncorrectCustomerIDTest()
        {
            DBDAL dbdal = new DBDAL();
            Order order = CreateTestOrder();

            order.CustomerID = "Hello world!!!";
            try
            {
                dbdal.Add(order);
                Assert.Fail("Не было выброшено ниодного исключения.");
            }
            catch (ArgumentException e)
            {
                StringAssert.Contains(e.Message, "Недопустимое значение параметра!");
            }
        }
        public void AddNewOrderWithIncorrectProductIDTest()
        {
            DBDAL dbdal = new DBDAL();
            Order order = CreateTestOrder();

            order.Details.Add(new OrderDetails(new Product(-97, "Scottish Longbreads"), 12.50, 42, 0));
            try
            {
                dbdal.Add(order);
                Assert.Fail("Не было выброшено ниодного исключения.");
            }
            catch (ArgumentException e)
            {
                StringAssert.Contains(e.Message, "Недопустимое значение параметра!");
            }
        }
 public void GetExistingOrderByIdTest()
 {
     DBDAL dbdal = new DBDAL();
     Order order = dbdal.GetById(11048);
     Order actualorder = new Order();
     actualorder.ID = 11048;
     actualorder.CustomerID = "BOTTM";
     actualorder.EmployeeID = 7;
     actualorder.OrderDate = new DateTime(1998, 4, 24);
     actualorder.RequiredDate = new DateTime(1998, 5, 22);
     actualorder.ShippedDate = new DateTime(1998, 4, 30);
     actualorder.ShipVia = 3;
     actualorder.Freight = 24.12;
     actualorder.ShipName = "Bottom-Dollar Markets";
     actualorder.ShipAddress = "23 Tsawassen Blvd.";
     actualorder.ShipCity = "Tsawassen";
     actualorder.ShipRegion = "BC";
     actualorder.ShipPostalCode = "T2F 8M4";
     actualorder.ShipCountry = "Canada";
     actualorder.Details.Add(new OrderDetails(new Product(68, "Scottish Longbreads"), 12.50, 42, 0));
     actualorder.Status = OrderStatus.SHIPPED;
     Assert.AreEqual(order, actualorder);
 }
        public void GetExistingOrderByIdTest()
        {
            DBDAL dbdal       = new DBDAL();
            Order order       = dbdal.GetById(11048);
            Order actualorder = new Order();

            actualorder.ID             = 11048;
            actualorder.CustomerID     = "BOTTM";
            actualorder.EmployeeID     = 7;
            actualorder.OrderDate      = new DateTime(1998, 4, 24);
            actualorder.RequiredDate   = new DateTime(1998, 5, 22);
            actualorder.ShippedDate    = new DateTime(1998, 4, 30);
            actualorder.ShipVia        = 3;
            actualorder.Freight        = 24.12;
            actualorder.ShipName       = "Bottom-Dollar Markets";
            actualorder.ShipAddress    = "23 Tsawassen Blvd.";
            actualorder.ShipCity       = "Tsawassen";
            actualorder.ShipRegion     = "BC";
            actualorder.ShipPostalCode = "T2F 8M4";
            actualorder.ShipCountry    = "Canada";
            actualorder.Details.Add(new OrderDetails(new Product(68, "Scottish Longbreads"), 12.50, 42, 0));
            actualorder.Status = OrderStatus.SHIPPED;
            Assert.AreEqual(order, actualorder);
        }
 public void AddTest()
 {
     DBDAL dbdal = new DBDAL();
     Order order = CreateTestOrder();
     int before = dbdal.GetAll().Count();
     dbdal.Add(order);
     int after = dbdal.GetAll().Count();
     Assert.AreEqual(before+1,after);
 }
 public void GetAllTest()
 {
     DBDAL dbdal = new DBDAL();
     Order[] allorders = dbdal.GetAll().ToArray();
     Assert.AreNotEqual(allorders.Length, 0);
 }
 public void ConstructorTest()
 {
     DBDAL dbdal = new DBDAL();
     Assert.IsNotNull(dbdal.ConnectionSB);
 }
 public void CustOrdersDetailTest()
 {
     DBDAL dbdal = new DBDAL();
     Assert.AreNotEqual(dbdal.CustOrdersDetail(10345).Count(), 0);
 }
 public void CustOrdersDetailIncorrectInputTest()
 {
     DBDAL dbdal = new DBDAL();
     Assert.AreEqual(dbdal.CustOrdersDetail(-34).Count(), 0);
 }
 public void CustOrderHistTest()
 {
     DBDAL dbdal = new DBDAL();
     Assert.AreNotEqual(dbdal.CustOrderHist("RATTC").Count(), 0);
 }
 public void CustOrderHistIncorrectInputTest()
 {
     DBDAL dbdal = new DBDAL();
     Assert.AreEqual(dbdal.CustOrderHist("Hello, world!").Count(), 0);
 }
 public void MarkAsDoneWithIncorrectOrderIdTest()
 {
     DBDAL dbdal = new DBDAL();
     try
     {
         dbdal.MarkAsDone(-57, DateTime.Now);
         Assert.Fail("Не было выброшено ниодного исключения.");
     }
     catch (ArgumentException e)
     {
         StringAssert.Contains(e.Message, "Недопустимое значение параметра!");
     }
 }
        public void CustOrdersDetailTest()
        {
            DBDAL dbdal = new DBDAL();

            Assert.AreNotEqual(dbdal.CustOrdersDetail(10345).Count(), 0);
        }
 public void GetNotExistingOrderByIdTest()
 {
     DBDAL dbdal = new DBDAL();
     Order order = dbdal.GetById(-345);
     Assert.IsNull(order);
 }
 public void AddNewOrderWithIncorrectProductIDTest()
 {
     DBDAL dbdal = new DBDAL();
     Order order = CreateTestOrder();
     order.Details.Add(new OrderDetails(new Product(-97, "Scottish Longbreads"), 12.50, 42, 0));
     try
     {
         dbdal.Add(order);
         Assert.Fail("Не было выброшено ниодного исключения.");
     }
     catch (ArgumentException e)
     {
         StringAssert.Contains(e.Message, "Недопустимое значение параметра!");
     }
 }
        public void SendToWorkTest()
        {
            DBDAL dbdal = new DBDAL();

            Assert.AreEqual(dbdal.SendToWork(10345, DateTime.Now), true);
        }
        public void ConstructorTest()
        {
            DBDAL dbdal = new DBDAL();

            Assert.IsNotNull(dbdal.ConnectionSB);
        }
        public void CustOrderHistIncorrectInputTest()
        {
            DBDAL dbdal = new DBDAL();

            Assert.AreEqual(dbdal.CustOrderHist("Hello, world!").Count(), 0);
        }
        public void CustOrderHistTest()
        {
            DBDAL dbdal = new DBDAL();

            Assert.AreNotEqual(dbdal.CustOrderHist("RATTC").Count(), 0);
        }
 public void SendToWorkTest()
 {
     DBDAL dbdal = new DBDAL();
     Assert.AreEqual(dbdal.SendToWork(10345, DateTime.Now), true);
 }
        public void CustOrdersDetailIncorrectInputTest()
        {
            DBDAL dbdal = new DBDAL();

            Assert.AreEqual(dbdal.CustOrdersDetail(-34).Count(), 0);
        }