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 }; }
/// <summary> /// Create a new ExitAlias object. /// </summary> /// <param name="aliasId">Initial value of the AliasId property.</param> /// <param name="exitId">Initial value of the ExitId property.</param> /// <param name="alais">Initial value of the Alais property.</param> public static ExitAlias CreateExitAlias(global::System.Int32 aliasId, global::System.Int32 exitId, global::System.String alais) { ExitAlias exitAlias = new ExitAlias(); exitAlias.AliasId = aliasId; exitAlias.ExitId = exitId; exitAlias.Alais = alais; return exitAlias; }
/// <summary> /// Deprecated Method for adding a new object to the ExitAliases EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToExitAliases(ExitAlias exitAlias) { base.AddObject("ExitAliases", exitAlias); }