Example #1
0
        public void StatsShouldPersistAccrossInstances()
        {
            StatsModel stats1 = new StatsModel();

            stats1.NumberOfGamesPlayed = 15;
            stats1.BestScore           = 4;

            StatsModel stats2 = new StatsModel();

            stats2.Load();
            Assert.AreEqual(15, stats2.NumberOfGamesPlayed);
            Assert.AreEqual(4, stats2.BestScore);
        }
Example #2
0
        public void ResetShouldWipeOutPersistedData()
        {
            StatsModel stats1 = new StatsModel();

            stats.NumberOfGamesPlayed = 15;
            stats.BestScore           = 4;
            stats1.Reset();

            StatsModel stats2 = new StatsModel();

            stats2.Load();
            Assert.AreEqual(0, stats2.NumberOfGamesPlayed);
            Assert.AreEqual(-1, stats2.BestScore);
        }
Example #3
0
 public void SetUp()
 {
     stats = new StatsModel();
     stats.Reset();
 }