Ejemplo n.º 1
0
        public InfoManagerTests()
        {
            _languageList = new List <Language>
            {
                new Language
                {
                    Id   = 1,
                    Name = "en",
                },
                new Language
                {
                    Id   = 2,
                    Name = "ru",
                },
            };

            _languageListDto = new List <LanguageDto>
            {
                new LanguageDto
                {
                    Id   = 1,
                    Name = "en",
                },
                new LanguageDto
                {
                    Id   = 2,
                    Name = "ru",
                }
            };

            _repoMock    = new Mock <IGroupRepository>();
            _data        = new Mock <IDataAdapter>();
            _infoManager = new InfoManager(_repoMock.Object, _data.Object);
        }
Ejemplo n.º 2
0
        public async Task GetLanguagesListAsync_ShouldNot_Return_NotNull()
        {
            //arrange
            _repoMock.Setup(r => r.GetListAsync <Language>()).Returns(Task.FromResult <IEnumerable <Language> >(_languageList));
            _infoManager = new InfoManager(_repoMock.Object, _data.Object);

            //act
            var result = await _infoManager.GetLanguagesListAsync();

            //assert
            Assert.NotNull(result);
        }
Ejemplo n.º 3
0
        public async Task GetLanguagesListAsync_Should_Return_SetValue()
        {
            //arrange
            _repoMock.Setup(r => r.GetListAsync <Language>()).Returns(Task.FromResult <IEnumerable <Language> >(_languageList));
            _infoManager = new InfoManager(_repoMock.Object, _data.Object);
            _data.Setup(d => d.Map <IEnumerable <LanguageDto> >(_languageList)).Returns(_languageListDto);

            //act
            var result = await _infoManager.GetLanguagesListAsync();

            //assert
            Assert.True(result.Count() == _languageList.Count());
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 用于自定义构建
        /// </summary>
        /// <param name="infoManager"></param>
        /// <param name="loaderManager"></param>
        /// <param name="requestManager"></param>
        public void Init(IInfoManager infoManager, LoaderManager loaderManager, IRequestManager requestManager)
        {
            if (m_Inited)
            {
                return;
            }

            m_Inited = true;

            SetupSystemEvents();

            m_InfoManager    = infoManager;
            m_LoaderManager  = loaderManager;
            m_RequestManager = requestManager;
        }
Ejemplo n.º 5
0
        public void Init(string allManifestFile = null, Action <bool> callback = null)
        {
            if (m_Inited)
            {
                if (m_InfoManager.inited)
                {
                    if (callback != null)
                    {
                        callback(true);
                    }
                }
                else
                {
                    m_InfoManager.onInitComplete += callback;
                }
                return;
            }
            m_Inited = true;

            //asset search path
            AssetPaths.SetupDefaultSearchPaths();

            //system events
            SetupSystemEvents();

            //crate loader manager
            m_LoaderManager = new LoaderManager(this);

            //create rquest manager
            m_RequestManager = new RequestManager(this);
            m_RequestManager.Init();

            //create info manager
            m_InfoManager = new InfoManager(this);
            m_InfoManager.Init();
            if (callback != null)
            {
                m_InfoManager.onInitComplete += callback;
            }

            if (string.IsNullOrEmpty(allManifestFile))
            {
                allManifestFile = AssetPaths.bundleManifestFile;
            }
            m_InfoManager.Load(AssetPaths.GetFullPath(allManifestFile));
        }
Ejemplo n.º 6
0
        public void Setup()
        {
            _infoManager = Substitute.For <IInfoManager>();
            _dataAdapter = Substitute.For <IDataAdapter>();
            _logger      = Substitute.For <ILogger <InfoController> >();

            _languageDtoList = new List <LanguageDto>
            {
                new LanguageDto
                {
                    Id   = 1,
                    Name = "en",
                },
                new LanguageDto
                {
                    Id   = 2,
                    Name = "ru",
                }
            };
        }
Ejemplo n.º 7
0
 public ReadyToStartState(IGameCore gameCore, IInfoManager infoManager)
 {
     this.infoManager = infoManager;
     this.gameCore    = gameCore;
 }
Ejemplo n.º 8
0
 public InfoController(IConfiguration config, IInfoManager infoManager)
 {
     _config      = config;
     _infoManager = infoManager;
 }
Ejemplo n.º 9
0
 public EndOfGameState(IPlayerChip playerChip, IInfoManager infoManager)
 {
     this.playerChip  = playerChip;
     this.infoManager = infoManager;
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="infoManager"></param>
 public Info(IInfoManager infoManager)
 {
     _infoManager = infoManager ?? throw new ArgumentNullException(nameof(infoManager));
 }
Ejemplo n.º 11
0
 public InfoController(IInfoManager infoManager, IDataAdapter dataAdapter, ILogger <InfoController> logger)
 {
     _infoManager = infoManager;
     _dataAdapter = dataAdapter;
     _logger      = logger;
 }