コード例 #1
0
 public void TestInitialization() {
   GameServiceContainer gameServices = new GameServiceContainer();
   MockedGraphicsDeviceService mockedGraphics = new MockedGraphicsDeviceService();
   gameServices.AddService(typeof(IGraphicsDeviceService), mockedGraphics);
   using(
     SharedContentManager contentManager = new SharedContentManager(gameServices)
   ) {
     contentManager.Initialize();
   }
 }
コード例 #2
0
 public void TestInitializationWithExistingGraphicsDevice() {
   GameServiceContainer gameServices = new GameServiceContainer();
   MockedGraphicsDeviceService mockedGraphics = new MockedGraphicsDeviceService();
   gameServices.AddService(typeof(IGraphicsDeviceService), mockedGraphics);
   using(IDisposable keeper = mockedGraphics.CreateDevice()) {
     using(
       SharedContentManager contentManager = new SharedContentManager(gameServices)
     ) {
       contentManager.Initialize();
     }
   }
 }