public void SelectByIdTest()
        {
            Order item = OrderTestData.CreateOrder1();
            Order find = this.Dao.SelectById(this.Context, item);

            Assert.AreEqual(item.Id, find.Id);
            OrderTestData.AssertAreEqual(item, find);
        }
        public void SelectByIdTest()
        {
            Order itemTest = OrderTestData.CreateOrder1();

            Order find = this.Service.SelectById(new Order {
                Id = itemTest.Id
            });

            Assert.IsNotNull(find);

            OrderTestData.AssertAreEqual(itemTest, find);
        }
        public void UpdateTest()
        {
            Order item         = OrderTestData.CreateOrder1();
            Order beforeUpdate = this.Dao.SelectById(this.Context, item);

            Assert.IsNotNull(beforeUpdate);
            beforeUpdate.Name = string.Empty;

            this.Dao.Update(this.Context, beforeUpdate);

            Order afterUpdate = this.Dao.SelectById(this.Context, beforeUpdate);

            OrderTestData.AssertAreEqual(beforeUpdate, afterUpdate);
        }
        public void UpdateTest()
        {
            Order itemTest = OrderTestData.CreateOrder1();

            Order beforeUpdate = this.Service.SelectById(new Order {
                Id = itemTest.Id
            });

            beforeUpdate.Name = string.Empty;
            this.Service.Update(beforeUpdate, true);

            Order afterUpdate = this.Service.SelectById(new Order {
                Id = itemTest.Id
            });

            OrderTestData.AssertAreEqual(beforeUpdate, afterUpdate);
        }
        public void SelectByTest()
        {
            Order itemTest = OrderTestData.CreateOrder1();

            List <Order> find = this.Service.SelectBy(new Order {
                Name = itemTest.Name
            }, new List <string> {
                "Name"
            });

            Assert.IsNotNull(find);

            foreach (Order item in find)
            {
                Assert.AreEqual(itemTest.Name, item.Name);
            }
        }
        public void DeleteTest()
        {
            Order item         = OrderTestData.CreateOrder1();
            Order beforedelete = this.Dao.SelectById(this.Context, item);

            Assert.IsNotNull(beforedelete);

            int affectedRows = this.Dao.Delete(this.Context, beforedelete);

            Assert.AreEqual(1, affectedRows);

            Order afterDelete = this.Dao.SelectById(this.Context, beforedelete);

            Assert.IsNull(afterDelete);

            List <Order> items = this.Dao.SelectAll(this.Context);

            Assert.AreEqual(OrderTestData.OrderCount - 1, items.Count);
        }