示例#1
0
        public void ConditionsMetTest_True()
        {
            factory.teamManager.calcGameProgress().ReturnsForAnyArgs(3);
            factory.gameTime.GetData().ReturnsForAnyArgs(new GameTimeData()
            {
                Date = new GameDate()
                {
                    DateTime = new DateTime(1, 1, 20)
                }
            });

            var mission = new MissionDefinition();

            mission.MissionHooks = new MissionHookList();
            mission.MissionHooks.MissionHooks = new List <MissionHook>();

            var empDef = Substitute.For <EmployeeDefinition>();

            empDef.SpawnWhenAllConditionsAreMet = true;
            empDef.GameProgress = 2;
            empDef.NumberOfDaysTillEmpCanSpawn = 10;
            empDef.MissionSucceeded            = new MissionDefinition[] { mission };
            factory.missionManager.GetData().Completed.Add(new Mission(mission));
            empDef.ItemsBought = new ItemDefinition[0];

            Assert.True(factory.ConditionsMet(empDef));
        }