Commits

Mark Heath committed 407b083

more refactoring and unit test cleanup

Comments (0)

Files changed (3)

MusicRater.Tests/ExtensionMethodsUnitTests.cs

     public class ExtensionMethodsUnitTests
     {
         [TestMethod]
-        public void TestOnceRoundStartingFrom()
+        public void TestOnceRoundStartingAfter()
         {
             int[] numbers = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
             int[] newList = numbers.OnceRoundStartingAfter(5).ToArray();

MusicRater/Persistence/IsolatedStoreTrackLoader.cs

     public class IsolatedStoreTrackLoader : ITrackLoader
     {
         public string FileName { get; private set; }
+        private readonly IIsolatedStore isoStore;
 
-        public IsolatedStoreTrackLoader(string fileName)
+        public IsolatedStoreTrackLoader(string fileName, IIsolatedStore isoStore)
         {
             this.FileName = fileName;
+            this.isoStore = isoStore;
         }
 
         public void BeginLoad()
         {
             var tracks = new List<Track>();
-            using (RatingsRepository repo = new RatingsRepository(new IsolatedStore()))
+            using (RatingsRepository repo = new RatingsRepository(isoStore))
             { 
                 tracks.AddRange(repo.Load(this.FileName));
             }

MusicRater/ViewModels/MainPageViewModel.cs

 using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
 using System.Linq;
-using System.Collections.ObjectModel;
 using System.Windows;
 using System.Windows.Controls;
-using System.Windows.Data;
 using System.Windows.Input;
 using System.Windows.Media;
 using System.Windows.Threading;
 using GalaSoft.MvvmLight;
 using GalaSoft.MvvmLight.Command;
 using MusicRater.ViewModels;
-using System.Collections.Generic;
 
 namespace MusicRater
 {
 
             //"http://www.archive.org/download/KvrOsc28TyrellN6/KvrOsc28TyrellN6_files.xml"
             var kvrLoader = new KvrTrackLoader("http://www.archive.org/download/KvrOsc29StringTheory/KvrOsc29StringTheory_files.xml");
-            var isoLoader = new IsolatedStoreTrackLoader(contestFileName);
+            var isoLoader = new IsolatedStoreTrackLoader(contestFileName, new IsolatedStore());
             ITrackLoader loader = new CombinedTrackLoader(kvrLoader, isoLoader);
             loader.Loaded += new EventHandler<LoadedEventArgs>(loader_Loaded);
             this.IsLoading = true;