Example #1
0
        public void PlayerProfileMergeTest()
        {
            var playerProfileDTO = new PlayerProfileDTO(_defaultPlayer, DateTime.Now);

            Assert.IsNotNull(playerProfileDTO);

            var playerProfileCI = new PlayerProfileCI(playerProfileDTO, _competitorId, _cultureFirst, new TestDataRouterManager(new CacheManager()));

            Assert.IsNotNull(playerProfileCI);

            Compare(playerProfileCI, _defaultPlayer, _cultureFirst);

            _defaultPlayer.name        = "John SecondName";
            _defaultPlayer.nationality = "uk 2";
            var playerProfileDTO2 = new PlayerProfileDTO(_defaultPlayer, DateTime.Now);

            Assert.IsNotNull(playerProfileDTO2);

            playerProfileCI.Merge(playerProfileDTO2, _competitorId, _cultureSecond);

            Assert.AreNotEqual(_defaultPlayer.name, playerProfileCI.GetName(_cultureFirst));
            Assert.AreNotEqual(_defaultPlayer.nationality, playerProfileCI.GetNationality(_cultureFirst));

            Compare(playerProfileCI, _defaultPlayer, _cultureSecond);
        }
Example #2
0
        public void PlayerProfileMergeNoDataTest()
        {
            _defaultPlayer.nationality            = null;
            _defaultPlayer.nickname               = null;
            _defaultPlayer.weightSpecified        = false;
            _defaultPlayer.jersey_numberSpecified = false;
            _defaultPlayer.country_code           = null;
            var playerProfileDTO = new PlayerProfileDTO(_defaultPlayer, DateTime.Now);

            Assert.IsNotNull(playerProfileDTO);

            var playerProfileCI = new PlayerProfileCI(playerProfileDTO, _competitorId, _cultureFirst, new TestDataRouterManager(new CacheManager()));

            Assert.IsNotNull(playerProfileCI);

            Compare(playerProfileCI, _defaultPlayer, _cultureFirst);

            _defaultPlayer.name        = "John Second Name";
            _defaultPlayer.nationality = "uk 2";
            var playerProfileDTO2 = new PlayerProfileDTO(_defaultPlayer, DateTime.Now);

            Assert.IsNotNull(playerProfileDTO2);

            playerProfileCI.Merge(playerProfileDTO2, _competitorId, _cultureSecond);

            Compare(playerProfileCI, _defaultPlayer, _cultureSecond);
        }
Example #3
0
        public void PlayerCompetitorAddProfileTest()
        {
            _defaultPlayerCompetitor.nationality = null;
            var playerCompetitorDTO = new PlayerCompetitorDTO(_defaultPlayerCompetitor);
            var playerProfileCI     = new PlayerProfileCI(playerCompetitorDTO, _competitorId, _cultureFirst, _dataRouterManager);

            var playerProfileDTO = new PlayerProfileDTO(_defaultPlayer, DateTime.Now);

            Assert.IsNotNull(playerProfileDTO);

            playerProfileCI.Merge(playerProfileDTO, _competitorId, _cultureSecond);

            Compare(playerProfileCI, _defaultPlayer, _cultureSecond);
        }