public void SetProfilePicture_TooFewWins()
        {
            var personalSetting = new PersonalSetting("peter#123");

            var player = PlayerOverallStats.Create("peter#123");

            for (int i = 0; i < 19; i++)
            {
                player.RecordWin(Race.HU, 1, true);
            }

            personalSetting.Players = new List <PlayerOverallStats> {
                player
            };
            SetPictureCommand cmd1 = new SetPictureCommand()
            {
                avatarCategory = AvatarCategory.HU,
                pictureId      = 1
            };

            personalSetting.SetProfilePicture(cmd1);

            SetPictureCommand cmd2 = new SetPictureCommand()
            {
                avatarCategory = AvatarCategory.HU,
                pictureId      = 2
            };
            var profilePicture = personalSetting.SetProfilePicture(cmd2);

            Assert.IsFalse(profilePicture);
            Assert.AreEqual(AvatarCategory.HU, personalSetting.ProfilePicture.Race);
            Assert.AreEqual(1, personalSetting.ProfilePicture.PictureId);
        }
Beispiel #2
0
        public void SetProfilePicture_ToFewWins()
        {
            var personalSetting = new PersonalSetting("peter#123");

            var player = PlayerOverallStats.Create("peter#123");

            for (int i = 0; i < 19; i++)
            {
                player.RecordWin(Race.HU, 1, true);
            }

            personalSetting.Players = new List <PlayerOverallStats> {
                player
            };
            personalSetting.SetProfilePicture(Race.HU, 1);
            var profilePicture = personalSetting.SetProfilePicture(Race.HU, 2);

            Assert.IsFalse(profilePicture);
            Assert.AreEqual(Race.HU, personalSetting.ProfilePicture.Race);
            Assert.AreEqual(1, personalSetting.ProfilePicture.PictureId);
        }