Inheritance: ISwiffotronStore
Example #1
0
 protected void CopyStoreToTestDir(MockStore store)
 {
     foreach (string commit in store.Commits)
     {
         if (store.Has(commit)) /* Well it might have been deleted */
         {
             using (Stream input = store.OpenInput(commit))
             using (FileStream output = new FileStream(TestDir + commit, FileMode.Create))
             {
                 CopyStream(input, output);
             }
         }
     }
 }
Example #2
0
 protected void CopyStoreToTestDir(MockStore store)
 {
     foreach (string commit in store.Commits)
     {
         if (store.Has(commit)) /* Well it might have been deleted */
         {
             using (Stream input = store.OpenInput(commit))
                 using (FileStream output = new FileStream(TestDir + commit, FileMode.Create))
                 {
                     CopyStream(input, output);
                 }
         }
     }
 }
Example #3
0
        /// <summary>
        /// Creates a swiffotron from the mock config profile and checks that everything is created
        /// correctly.
        /// </summary>
        /// <param name="mockStore">Returns a reference to the private store for testing.</param>
        /// <param name="htCache">Returns a reference to the private cache for testing.</param>
        /// <returns>A private accessor reference to the new Swiffotron.</returns>
        protected Swiffotron CreateMockSwiffotron(out MockStore mockStore, out MockCache htCache)
        {
#if(EXPRESS2010)
            Swiffotron swiffotron = new Swiffotron(ResourceAsStream(@"mock-config-express.xml"));
#else
            Swiffotron swiffotron = new Swiffotron(ResourceAsStream(@"mock-config.xml"));
#endif

            mockStore = (MockStore)swiffotron.conf_accessor.Stores.stores_accessor[@"store"];
            Assert.IsNotNull(mockStore, @"The store object was not created.");
            Assert.IsTrue(mockStore.InitialisedProperly, @"The store was not initialised properly");

            htCache = (MockCache)swiffotron.conf_accessor.Caches.caches_accessor[@"cache"];

            Assert.IsNotNull(htCache, @"The cache object was not created.");

            return swiffotron;
        }
Example #4
0
        /// <summary>
        /// Creates a swiffotron from the mock config profile and checks that everything is created
        /// correctly.
        /// </summary>
        /// <param name="mockStore">Returns a reference to the private store for testing.</param>
        /// <param name="htCache">Returns a reference to the private cache for testing.</param>
        /// <returns>A private accessor reference to the new Swiffotron.</returns>
        protected Swiffotron CreateMockSwiffotron(out MockStore mockStore, out MockCache htCache)
        {
#if (EXPRESS2010)
            Swiffotron swiffotron = new Swiffotron(ResourceAsStream(@"mock-config-express.xml"));
#else
            Swiffotron swiffotron = new Swiffotron(ResourceAsStream(@"mock-config.xml"));
#endif

            mockStore = (MockStore)swiffotron.conf_accessor.Stores.stores_accessor[@"store"];
            Assert.IsNotNull(mockStore, @"The store object was not created.");
            Assert.IsTrue(mockStore.InitialisedProperly, @"The store was not initialised properly");

            htCache = (MockCache)swiffotron.conf_accessor.Caches.caches_accessor[@"cache"];

            Assert.IsNotNull(htCache, @"The cache object was not created.");

            return(swiffotron);
        }