Ejemplo n.º 1
0
        public void TestMethod1()
        {
            Dice dice = new Dice();
            var  a    = new Animal();

            a.Armor = 5;
            AnimalBuilderAE.RunScript(a, dice, "animal.Armor = 0;");
            Assert.AreEqual(0, a.Armor);
        }
Ejemplo n.º 2
0
        protected async void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            string appDataPath = Server.MapPath("~/app_data");
            var    filterUnpopulatedSectors = bool.Parse(WebConfigurationManager.AppSettings["FilterUnpopulatedSectors"]);

            MapService      = new TravellerMapService(filterUnpopulatedSectors);
            TradeEngineMgt  = new TradeEngineMgt(MapService, appDataPath);
            TradeEngineMgt2 = new TradeEngineMgt2(MapService, appDataPath);

            AnimalBuilderMgt.SetDataPath(appDataPath);
            AnimalBuilderAE.SetDataPath(appDataPath);
            CharacterBuilder = new CharacterBuilder(appDataPath);
            EquipmentBuilder = new EquipmentBuilder(appDataPath);

            HomeIndexViewModel = HomeIndexViewModel.GetHomeIndexViewModel(MapService, CharacterBuilder, EquipmentBuilder).Result;
        }
Ejemplo n.º 3
0
        public void TestMethod2()
        {
            Dice dice   = new Dice();
            var  animal = new Animal();

            animal.Skills.Add("Stealth", 2);
            animal.Skills.Remove("Stealth");
            AnimalBuilderAE.RunScript(animal, dice, "animal.Skills.Remove(\"Stealth\");");
            Assert.IsNull(animal.Skills["Stealth"]);

            if (animal.Movement == "Flight")
            {
                animal.Movement  = "Walk";
                animal.Strength += dice.D(1, 6);
            }
            else
            {
                animal.Movement += " Flight";
                animal.Strength -= 1;
                animal.Armor    -= 1;
            }
        }