oibo8x / subsonicproject

Automatically exported from code.google.com/p/subsonicproject
0 stars 0 forks source link

IsLoaded not working properly in the subsonic final version #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create and instance by passing the column name and value
2. Checked the instancename.IsLoaded property to verify the existence of
the value in the DB Table.
3. It is returning true for all. Even the column is there or not in the
database

What is the expected output? What do you see instead?

if the column in the DB-table does not contain the value it should return
false as the instance is not created. but it is returning true.

code snippet:
==============

eg: 
AVLS.MasterObjects.Driver driver = new  
                           AVLS.MasterObjects.Driver("LicenseNo", "AP11");
driver.IsLoaded is true 
AP11 exists so the IsLoaded worked

AVLS.MasterObjects.Driver driver = new  
                           AVLS.MasterObjects.Driver("LicenseNo", "AP99");
driver.IsLoaded is true again
AP99 does not exists in the database. Here IsLoaded is not working.

What version of the product are you using? On what operating system?
SubSonic 2.1 Final

Please provide any additional information below.

Original issue reported on code.google.com by madhukar...@gmail.com on 23 Jul 2008 at 8:13

GoogleCodeExporter commented 9 years ago
Can you help me repro this with a test? Here's my passing test:

        [Test]
        public void ActiveRecord_IsLoaded_ShouldBe_False_When_Record_Not_Present() {

            Product p = new Product(1);
            Assert.IsTrue(p.IsLoaded);

            p = new Product(1111111);
            Assert.IsFalse(p.IsLoaded);

        }

Can't repro this...

Original comment by robcon...@gmail.com on 8 Apr 2009 at 3:18

GoogleCodeExporter commented 9 years ago
The difference between your test and the original issue is the constructor 
used. Does 
it repro if you use the other constructor overload?

Original comment by rimsyst...@gmail.com on 8 Apr 2009 at 3:54

GoogleCodeExporter commented 9 years ago
Ahh - thanks. Found it.

Fixed in revision 496

Original comment by robcon...@gmail.com on 8 Apr 2009 at 5:26