本文整理汇总了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());
}
示例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 };
}
示例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);
}
示例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");
}