示例#1
0
        public void CanBuildBank()
        {
            var stubContentManager = MockRepository.GenerateStub<IContentManager>();
            XnaTextureBank<TestTextures> playerTextureBank = new XnaTextureBank<TestTextures>(stubContentManager);

            stubContentManager.AssertWasCalled(x => x.Load<ITexture>(XnaTextureBank<TestTextures>.PlayerTextureDirectory + TestTextures.Texture1.ToString()));
            stubContentManager.AssertWasCalled(x => x.Load<ITexture>(XnaTextureBank<TestTextures>.PlayerTextureDirectory + TestTextures.Texture2.ToString()));
        }
示例#2
0
        public void CanIndexTextureBank()
        {
            var stubContentManager = MockRepository.GenerateStub<IContentManager>();
            var stubTexture = MockRepository.GenerateStub<ITexture>();
            stubContentManager.Stub(x => x.Load<ITexture>(XnaTextureBank<TestTextures>.PlayerTextureDirectory + TestTextures.Texture2.ToString())).Return(stubTexture);
            XnaTextureBank<TestTextures> playerTextureBank = new XnaTextureBank<TestTextures>(stubContentManager);

            Assert.AreEqual(stubTexture, playerTextureBank[TestTextures.Texture2]);
        }