Example #1
0
        public void EocStatsDataContainer_Write_ToDisk()
        {
            // Arrange
            // TODO: Implement ArtifactFolder
            var container = new EocStatsDataContainer
            {
                FilePath = "TestUserStatsBinary.dat", Data = CreateTestStatsData(),
            };

            // Act
            container.Write();
            // Assert
            // clear the data and read it
            container.Data = null;
            container.Read();
            ValidateTestStatsData(container.Data);
        }
Example #2
0
        public void EocStatsDataContainer_Read_FromDisk()
        {
            // Arrange
            var container = new EocStatsDataContainer
            {
                FilePath = Path.Combine("TestFiles", EocStatsDataContainer.DefaultFileName),
            };

            // Act
            container.Read();
            // Assert
            var data = container.Data;

            Assert.IsNotNull(data);
            Assert.AreEqual(new DateTime(634544894826625391), data.LastUpdated);
            Assert.AreEqual(142307, data.UserTwentyFourHourAverage);
            Assert.AreEqual(216422, data.UserPointsToday);
            Assert.AreEqual(298200, data.UserPointsWeek);
            Assert.AreEqual(106207955, data.UserPointsTotal);
            Assert.AreEqual(84390, data.UserWorkUnitsTotal);
            Assert.AreEqual(3975, data.UserPointsUpdate);
            Assert.AreEqual(9, data.UserTeamRank);
            Assert.AreEqual(109, data.UserOverallRank);
            Assert.AreEqual(0, data.UserChangeRankTwentyFourHours);
            Assert.AreEqual(0, data.UserChangeRankSevenDays);
            Assert.AreEqual(5384879, data.TeamTwentyFourHourAverage);
            Assert.AreEqual(5018383, data.TeamPointsToday);
            Assert.AreEqual(10231667, data.TeamPointsWeek);
            Assert.AreEqual(4596308949, data.TeamPointsTotal);
            Assert.AreEqual(9348380, data.TeamWorkUnitsTotal);
            Assert.AreEqual(1110543, data.TeamPointsUpdate);
            Assert.AreEqual(4, data.TeamRank);
            Assert.AreEqual(0, data.TeamChangeRankTwentyFourHours);
            Assert.AreEqual(0, data.TeamChangeRankSevenDays);
            // not serialized
            Assert.IsNull(data.Status);
        }