EntropyZero Blogging Server

Welcome to EntropyZero Blogging Server Sign in | Join | Help
in Search

problems with DataFreshInstance.RefreshTheDatabase();

Last post 11-14-2006, 4:30 PM by mike.brockey. 1 replies.
Sort Posts: Previous Next
  •  11-09-2006, 6:32 AM 81

    problems with DataFreshInstance.RefreshTheDatabase();

    Hi

    I've tried to  start testing on sql2005 with DataFresh but found a problem.

    I downloaded your dataFresh sample and tried to implement 2 test cases.
    Thats what I had:

     public class ExportStatesLoggerDalcTests:TestFixtureBase
        {

            [Test]
            public void AddDbName_DbNameNotExists_ReturnsId()
            {
                EntitiesLoggerDalc dalc = new EntitiesLoggerDalc();

                int i = dalc.AddDbName("NewDataName123");
                Assert.Greater(i, 0);
            }

            [Test]
            public void FindDbId_DbNameExists_ReturnsDbId()
            {
                EntitiesLoggerDalc dalc = new EntitiesLoggerDalc();
                int? i = dalc.FindDbId("DbId1"); //in Setup.sql  I insert this entity.
                Assert.IsNotNull(i); //Fails, my table is empty.
            }}


    I found, that when my second test runs all data is being erased after
                    DataFreshInstance.RefreshTheDatabase();

    but I expected, that the data inserted in Setup.sql is in my tables. Am I right ?
     

    Filed under:
  •  11-14-2006, 4:30 PM 85 in reply to 81

    Re: problems with DataFreshInstance.RefreshTheDatabase();

    Mind posting the code where you are preparing your database? 

    PREPARE should be called once your database has been created including the execution of setup.sql.  If you are calling PREPARE with an argument of false, this will delay the generation of your snapshot, you must then call the CreateSnapshot method.  Otherwise your tables will be cleared and there will be no data to restore.


    Mike Brockey
    Senior Architect/Owner
    EntropyZero Consulting, LLC
    Filed under: ,
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems