locked
An explicit conversion error RRS feed

  • Question

  • User888441741 posted

    whats wrong here?

    error
    //

    Error 6 Cannot implicitly convert type 'CacheStorage' to 'ICacheStorage'. An explicit conversion exists (are you missing a cast?) 

     

    [TestMethod]
            public void load_all_escort_dataservice_with_cache()
            { 
                 IEscortRepository _realEscortRepository = new EscortRepository();
                 ICacheStorage _cacheStorage = new CacheStorage(); //error <<<<
    
    
                IEscortService escortServiceWithCache =
                    new EscortServiceWithCache(_realEscortRepository, _cacheStorage);
    
          
    
                //arragnge 
                Assert.AreEqual(escortServiceWithCache.LoadEscort().Count, 5);
               
            }
    


     

     

    Monday, February 22, 2010 1:54 PM

Answers

  • User-294030300 posted

    Hey,

    Does CacheStorage implement ICacheStorage interface?  The compiler says it doesn't. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 22, 2010 2:33 PM