Exemplo n.º 1
0
        public void SelectByIdTest()
        {
            Organization item = OrganizationTestData.CreateOrganization1();
            Organization find = this.Dao.SelectById(this.Context, item);

            Assert.AreEqual(item.Id, find.Id);
            OrganizationTestData.AssertAreEqual(item, find);
        }
Exemplo n.º 2
0
        public void SelectByIdTest()
        {
            Organization itemTest = OrganizationTestData.CreateOrganization1();

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

            Assert.IsNotNull(find);

            OrganizationTestData.AssertAreEqual(itemTest, find);
        }
Exemplo n.º 3
0
        public void UpdateTest()
        {
            Organization item         = OrganizationTestData.CreateOrganization1();
            Organization beforeUpdate = this.Dao.SelectById(this.Context, item);

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

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

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

            OrganizationTestData.AssertAreEqual(beforeUpdate, afterUpdate);
        }
Exemplo n.º 4
0
        public void UpdateTest()
        {
            Organization itemTest = OrganizationTestData.CreateOrganization1();

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

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

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

            OrganizationTestData.AssertAreEqual(beforeUpdate, afterUpdate);
        }
Exemplo n.º 5
0
        public void SelectByTest()
        {
            Organization itemTest = OrganizationTestData.CreateOrganization1();

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

            Assert.IsNotNull(find);

            foreach (Organization item in find)
            {
                Assert.AreEqual(itemTest.Description, item.Description);
            }
        }
Exemplo n.º 6
0
        public void DeleteTest()
        {
            Organization item         = OrganizationTestData.CreateOrganization1();
            Organization beforedelete = this.Dao.SelectById(this.Context, item);

            Assert.IsNotNull(beforedelete);

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

            Assert.AreEqual(1, affectedRows);

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

            Assert.IsNull(afterDelete);

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

            Assert.AreEqual(OrganizationTestData.OrganizationCount - 1, items.Count);
        }