views:

33

answers:

0

Hi everyone,

I am trying to call a method that passes an object called parameters.

    public void LoadingDataLockFunctionalityTest()
    {
        DataCache_Accessor target = DataCacheTest.getNewDataCacheInstance();

        target.itemsLoading.Add("WebFx.Caching.TestDataRetrieverFactorytestsync", true);

        DataParameters parameters = new DataParameters("WebFx.Core",
            "WebFx.Caching.TestDataRetrieverFactory",
            "testsync");



        parameters.CachingStrategy = CachingStrategy.TimerDontWait;
        parameters.CacheDuration = 0;
        string data = (string)target.performGetForTimerDontWaitStrategy(parameters);
        TestSyncDataRetriever.SimulateLoadingForFiveSeconds = true;
        Thread t1 = new Thread(delegate()
        {
            string s = (string)target.performGetForTimerDontWaitStrategy(parameters);
            Console.WriteLine(s ?? String.Empty);
        });
        t1.Start();
        t1.Join();


        Thread.Sleep(1000);

        ReaderWriterLockSlim rw = DataCache_Accessor.GetLoadingLock(parameters);


        Assert.IsTrue(rw.IsWriteLockHeld);
        Assert.IsNotNull(data);
    }

My test is failing all the time and i am not able step through the method..

Can someone please put me in the right direction

Thanks