コード例 #1
0
        public void SetUp()
        {
            _configSettingsMock = new Mock<IConfigurationSettings>();
            _configSettingsMock.SetupGet(x => x.DataDirectory).Returns(GetTestDataDirectory());
            _configSettingsMock.SetupGet(x => x.ValidPlayerJsonCacheHours).Returns(48);

            var remotePlayerService = new RemotePlayerJsonService();

            var localPlayerService = new LocalPlayerJsonService(_configSettingsMock.Object, remotePlayerService, new Mock<ILogger>().Object);

            var jsonParsingService = new JsonParsingSinglePlayerService(localPlayerService, new Mock<ILogger>().Object);

            var playerService = new PlayerService(jsonParsingService);
            _multiplePlayersService = playerService;

            var unityContainer = ContainerBuilder.BuildUnityContainer();
            MappingConfiguration.Bootstrap(unityContainer);
        }
コード例 #2
0
        public void SetUp()
        {
            string testDataDir = GetTestDataDirectory();
            _configSettingsMock = new Mock<IConfigurationSettings>();
            _configSettingsMock.SetupGet(x => x.DataDirectory).Returns(testDataDir);

            _childJsonServiceMock = new Mock<IPlayerJsonService>();

            _service = new LocalPlayerJsonService(_configSettingsMock.Object, _childJsonServiceMock.Object, new Mock<ILogger>().Object);
        }