Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #5
0
        public void InsertTest()
        {
            Organization item = new Organization
            {
                Description = string.Empty,
                Name        = string.Empty,
            };
            int affectedRows = this.Dao.Insert(this.Context, item);

            Assert.AreEqual(1, affectedRows);

            Organization find = this.Dao.SelectById(this.Context, item);

            OrganizationTestData.AssertAreEqual(item, find);

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

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