当前位置: 首页>>代码示例>>C#>>正文


C# IPlayer.Stub方法代码示例

本文整理汇总了C#中IPlayer.Stub方法的典型用法代码示例。如果您正苦于以下问题:C# IPlayer.Stub方法的具体用法?C# IPlayer.Stub怎么用?C# IPlayer.Stub使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPlayer的用法示例。


在下文中一共展示了IPlayer.Stub方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetUp

 public void SetUp()
 {
     player = MockRepository.GenerateStub<IPlayer>();
     player.Stub(me => me.Weapons).Return(MockRepository.GenerateStub<IWeapons>());
     player.Weapons.Stub(me => me.Shots).Return(new Shots());
     player.Stub(me => me.PlayerScore).Return(new PlayerScore());
 }
开发者ID:zakvdm,项目名称:Frenetic,代码行数:7,代码来源:PlayerStateTests.cs

示例2: Before_Each_Test

        public void Before_Each_Test()
        {
            console = MockRepository.GenerateMock<IConsoleFacade>();
            repository = MockRepository.GenerateMock<IRepository<GameObject>>();
            player = MockRepository.GenerateMock<IPlayer>();

            dbPlayer = new GameObject() { GameObjectId = 3, Location = dbHallway, Location_Id = 8, Description = "Just some dude." };
            player.Stub(qq => qq.Id).Return(3);
            dbHallway = new GameObject() { Name = "Hallway", Description = " It's a hallway", GameObjectId = 8 };
            dbBall = new GameObject() { Name = "Ball", Description = "A shiny rubber ball", Location = dbPlayer, Location_Id = 3 };
            dbRing = new GameObject() { Name = "Ring", Description = "A simple gold ring", Location = dbHallway, Location_Id = 8 };
            dbExit = new GameObject() {Name = "Exit", Description ="", Location= dbHallway, Location_Id = 8, GameObjectId = 16, Type = "Exit", Destination = 8 };

            dbPlayer.Inventory.Add(dbBall);
            dbHallway.Inventory.Add(dbPlayer);
            dbHallway.Inventory.Add(dbRing);
            dbHallway.Inventory.Add(dbExit);
            dbList = new List<GameObject>() { dbPlayer, dbBall, dbRing, dbExit, dbHallway };
            repository.Stub(qq => qq.AsQueryable()).Return(dbList.AsQueryable());

            exit = new ExitAlias() { AliasId = 2, ExitId = 16, Alais = "North" };
            exit2 = new ExitAlias() { AliasId = 2, ExitId = 16, Alais = "Hall" };
            dbExit.ExitAliases.Add(exit);
            dbExit.ExitAliases.Add(exit2);
            aliasList = new List<ExitAlias> { exit, exit2 };
        }
开发者ID:csjackson,项目名称:Adventure,代码行数:26,代码来源:BaseTest.cs

示例3: SetUp

 public void SetUp()
 {
     playerList = MockRepository.GenerateStub<IPlayerList>();
     playerList.Stub(me => me.Players).Return(new List<IPlayer>());
     stubTexture = MockRepository.GenerateStub<ITexture>();
     _stubTextureBank = MockRepository.GenerateStub<ITextureBank<PlayerTexture>>();
     _stubTextureBank.Stub(x => x[PlayerTexture.Ball]).Return(stubTexture);
     stubSpriteBatch = MockRepository.GenerateStub<ISpriteBatch>();
     stubCamera = MockRepository.GenerateStub<ICamera>();
     stubWeaponDrawer = MockRepository.GenerateStub<IWeaponDrawer>();
     stubBubbleText = MockRepository.GenerateStub<IBubbleTextDrawer>();
     player = MockRepository.GenerateStub<IPlayer>();
     player.Status = PlayerStatus.Alive;
     player.Stub(me => me.PlayerSettings).Return(new NetworkPlayerSettings());
     player.Stub(me => me.Weapons).Return(MockRepository.GenerateStub<IWeapons>());
     playerList.Players.Add(player);
     playerView = new PlayerView(playerList, _stubTextureBank, stubSpriteBatch, stubCamera, stubWeaponDrawer, stubBubbleText);
 }
开发者ID:zakvdm,项目名称:Frenetic,代码行数:18,代码来源:PlayerViewTests.cs

示例4: setup

        public void setup()
        {
            _deck = MockRepository.GenerateMock<IDeck>();
            _agent = MockRepository.GenerateMock<IGAgent>();
            _agent.Stub(x => x.Deck).Return(_deck);

            _owner = MockRepository.GenerateMock<IPlayer>();
            _owner.Stub(x => x.Id).Return(Guid.NewGuid());
            _owner.Stub(x => x.DisplayHandle).Return("owner1");

            _owner2 = MockRepository.GenerateMock<IPlayer>();
            _owner2.Stub(x => x.Id).Return(Guid.NewGuid());
            _owner2.Stub(x => x.DisplayHandle).Return("owner2");

            myPlayer = MockRepository.GenerateMock<IPlayer>();
            myPlayer.Stub(x => x.Id).Return(Guid.NewGuid());
            myPlayer.Stub(x => x.DisplayHandle).Return("player");

            uid = MockRepository.GenerateMock < IPlayer>();
            uid.Stub(x => x.Id).Return(Guid.NewGuid());
            uid.Stub(x => x.DisplayHandle).Return("uid0");
        }
开发者ID:goncalopereira,项目名称:Gr1d,代码行数:22,代码来源:MoveTests.cs


注:本文中的IPlayer.Stub方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。