示例#1
0
        public void PlayerProfileExportImportTest()
        {
            var playerProfileDTO = new PlayerProfileDTO(_defaultPlayer, DateTime.Now);
            var playerProfileCI  = new PlayerProfileCI(playerProfileDTO, _competitorId, _cultureFirst, new TestDataRouterManager(new CacheManager()));

            var exportable = (ExportablePlayerProfileCI)playerProfileCI.ExportAsync().Result;

            playerProfileCI.Import(exportable);
            var playerProfileCI2 = new PlayerProfileCI(exportable, _dataRouterManager);

            Assert.IsNotNull(playerProfileCI2);

            Compare(playerProfileCI, playerProfileCI2);
        }
示例#2
0
        public void PlayerProfileExportImportMissingDataTest()
        {
            _defaultPlayer.nationality            = null;
            _defaultPlayer.nickname               = null;
            _defaultPlayer.weightSpecified        = false;
            _defaultPlayer.jersey_numberSpecified = false;
            _defaultPlayer.country_code           = null;
            var playerProfileDTO = new PlayerProfileDTO(_defaultPlayer, DateTime.Now);
            var playerProfileCI  = new PlayerProfileCI(playerProfileDTO, _competitorId, _cultureFirst, new TestDataRouterManager(new CacheManager()));

            var exportable = (ExportablePlayerProfileCI)playerProfileCI.ExportAsync().Result;

            playerProfileCI.Import(exportable);
            var playerProfileCI2 = new PlayerProfileCI(exportable, _dataRouterManager);

            Assert.IsNotNull(playerProfileCI2);

            Compare(playerProfileCI, playerProfileCI2);
        }