Пример #1
0
        public void InsertEntityWithoutAttributes()
        {
            EntityWithoutTableInfo ewa = new EntityWithoutTableInfo()
            {
                Attribute1 = "Attribute1",
                Attribute2 = "Attribute2"
            };

            Repository <EntityWithoutTableInfo> ewaRepo = new Repository <EntityWithoutTableInfo>(Fixture.Connection);
            int id = (int)ewaRepo.Add(ewa);

            Assert.Equal("Attribute1", ewaRepo.ReadOne <string>("Attribute1", id));
        }
Пример #2
0
        public void UpdateEntityWithoutAttributes()
        {
            EntityWithoutTableInfo ewa = new EntityWithoutTableInfo()
            {
                Attribute1 = "Attribute1",
                Attribute2 = "Attribute2"
            };

            Repository <EntityWithoutTableInfo> ewaRepo = new Repository <EntityWithoutTableInfo>(Fixture.Connection);
            int id = (int)ewaRepo.Add(ewa);

            ewa = ewaRepo.ReadOne(id);

            ewa.Attribute1 = "Updated Attribute1";

            ewaRepo.Update(ewa);
            Assert.Equal("Updated Attribute1", ewaRepo.ReadOne(id).Attribute1);
        }