コード例 #1
0
        protected override void OverrideIoC()
        {
            base.OverrideIoC();
            var mock    = new Mock <IEntitySystemManager>();
            var broady  = new BroadPhaseSystem();
            var physics = new PhysicsSystem();

            mock.Setup(m => m.GetEntitySystem <SharedBroadPhaseSystem>()).Returns(broady);
            mock.Setup(m => m.GetEntitySystem <SharedPhysicsSystem>()).Returns(physics);

            IoCManager.RegisterInstance <IEntitySystemManager>(mock.Object, true);
        }
コード例 #2
0
ファイル: MapLoaderTest.cs プロジェクト: Ygg01/RobustToolbox
        protected override void OverrideIoC()
        {
            base.OverrideIoC();
            //var mockFormat = new Mock<ICustomFormatManager>();
            var mock         = new Mock <IEntitySystemManager>();
            var broady       = new BroadPhaseSystem();
            var physics      = new PhysicsSystem();
            var gridFixtures = new GridFixtureSystem();

            mock.Setup(m => m.GetEntitySystem <SharedBroadphaseSystem>()).Returns(broady);
            mock.Setup(m => m.GetEntitySystem <SharedPhysicsSystem>()).Returns(physics);
            mock.Setup(m => m.GetEntitySystem <GridFixtureSystem>()).Returns(gridFixtures);

            IoCManager.RegisterInstance <IEntitySystemManager>(mock.Object, true);
            //IoCManager.RegisterInstance<ICustomFormatManager>(mockFormat.Object, true);
        }
コード例 #3
0
        protected override void OverrideIoC()
        {
            base.OverrideIoC();
            //var mockFormat = new Mock<ICustomFormatManager>();
            var mock         = new Mock <IEntitySystemManager>();
            var broady       = new BroadPhaseSystem();
            var physics      = new PhysicsSystem();
            var gridFixtures = new GridFixtureSystem();
            var fixtures     = new FixtureSystem();

            // MOCKS WHY
            mock.Setup(m => m.GetEntitySystem <SharedBroadphaseSystem>()).Returns(broady);
            mock.Setup(m => m.GetEntitySystem <SharedPhysicsSystem>()).Returns(physics);
            mock.Setup(m => m.GetEntitySystem <GridFixtureSystem>()).Returns(gridFixtures);
            mock.Setup(m => m.GetEntitySystem <FixtureSystem>()).Returns(fixtures);

            IoCManager.RegisterInstance <IEntitySystemManager>(mock.Object, true);
            //IoCManager.RegisterInstance<ICustomFormatManager>(mockFormat.Object, true);

            // Mocking moment...
            IoCManager.BuildGraph();
            IoCManager.RegisterInstance <SharedBroadphaseSystem>(broady);
            IoCManager.InjectDependencies(fixtures);
        }