public void Setup() { _abilityManager = new AbilityManager(); _characterManager = new CharacterManager(@"E:\Dev\Kaerber.MUD\Assets", _abilityManager); _userManager = new UserManager(@"E:\Dev\Kaerber.MUD\Assets\players", _characterManager); UnityConfigurator.Configure(); }
static void Main(string[] args) { //System.IO.Directory.SetCurrentDirectory(System.AppDomain.CurrentDomain.BaseDirectory); var container = new UnityContainer(); container.RegisterType <BootstrapService>(); var configurator = new UnityConfigurator(); //Log4NetSetup.Configure(); configurator.Configure(container); HostFactory.Run(x => { x.UseUnityContainer(container); x.Service <BootstrapService>(s => { s.ConstructUsingUnityContainer(); s.WhenStarted(tc => tc.Start()); s.WhenStopped(tc => tc.Stop()); }); x.RunAsLocalSystem(); x.SetDescription("Rule Engine Jobs Processor"); x.SetDisplayName("Rule Engine Evaluator"); x.SetServiceName("RuleEngineEvaluator"); x.SetInstanceName(ConfigurationManager.AppSettings["InstanceName"]); }); }
protected void ConfigureTelnetContainer() { Container = TelnetSession.TelnetContainer( UnityConfigurator.Configure()); MockConnection = new Mock <TelnetConnection>(null, null); Container.RegisterInstance(MockConnection.Object); }
private void Application_Startup(object sender, StartupEventArgs e) { var unityConfigurator = new UnityConfigurator(); var container = unityConfigurator.GetConfiguredContainer(); var mainWindow = (MainWindow)container.Resolve(typeof(MainWindow), "MainWindow"); mainWindow.Show(); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); UnityConfigurator.ConfigureIOCContainer(); }
public void Setup() { UnityConfigurator.Configure(); _abilityManager = new AbilityManager(); _characterManager = new CharacterManager(@"E:\Dev\Kaerber.MUD\Assets", _abilityManager); _itemManager = new ItemManager(@"E:\Dev\Kaerber.MUD\Assets"); _manager = new AreaManager(@"E:\Dev\Kaerber.MUD\Assets", _characterManager, _itemManager); }
protected void CreateTestEnvironment() { var container = UnityConfigurator.Configure(); container.RegisterInstance(new Clock(0)); World = container.Resolve <World>(); World.Instance = World; TestRoom = AddTestRoom("test", "Test", World); CreateTestPlayer(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configuration(IAppBuilder app) { GlobalConfiguration.Configure(WebApiConfig.Register); UnityConfigurator.Configure(GlobalConfiguration.Configuration); SwaggerConfigurator.Configure(GlobalConfiguration.Configuration); HangfireConfigurator.Configure(Hangfire.GlobalConfiguration.Configuration, app); var logService = UnityConfigurator.ResolveDependency <ILogService>(); var dequeueService = UnityConfigurator.ResolveDependency <IDequeueService>(); RecurringJob.AddOrUpdate("delete-old-logs", () => logService.DeleteOldLogs(), Cron.Daily); RecurringJob.AddOrUpdate("dequeue", () => dequeueService.Execute(), Cron.Minutely); }
public void CreateItem() { var container = UnityConfigurator.Configure(); World.Instance = container.Resolve <World>(); var template1 = new Item { Id = "test_1", ShortDescr = "Test 1" }; World.Instance.Items.Add(template1.Id, template1); var item1 = Item.Create("test_1"); Assert.AreEqual(1, item1.Count); }
public void LoadUserTest() { var container = UnityConfigurator.Configure(); World.Instance = container.Resolve <World>(); const string userName = "******"; var abilityManager = new AbilityManager(); var user = new UserManager(@"E:\Dev\Kaerber.MUD\assets\players\", new CharacterManager(@"E:\Dev\Kaerber.MUD\assets\", abilityManager)) .Load(string.Empty, userName); Assert.NotNull(user); Assert.AreEqual(user.Username, userName); }
public void CreateItemWithStack() { var container = UnityConfigurator.Configure(); World.Instance = container.Resolve <World>(); var template2 = new Item { Id = "test_2", ShortDescr = "Test 2", MaxCount = 5 }; World.Instance.Items.Add(template2.Id, template2); var item2 = Item.Create("test_2"); item2.AddQuantity(1); Assert.AreEqual(1, item2.Count); }
public void DeserializeTest() { var container = UnityConfigurator.Configure(); World.Instance = container.Resolve <World>(); var data = JsonConvert.DeserializeObject( @"{'Vnum':'test_entity','Names':'test entity','ShortDescr':'test entity'," + "'Stats':{'HP':0,'AC':{'Slash':0},'HitRoll':0}," + "'NaturalWeapon':{'BaseDamage':40},'PowerLevel':0,'PowerPoints':0,'ToNextPowerLevel':0," + "'Handlers':{'map':{'ch_says_text':{'Code':'import clr'}}}" + "}"); var entity = CharacterManager.Deserialize(data); Assert.IsNotNull(entity); }
public void SerializeTest() { var container = UnityConfigurator.Configure(); World.Instance = container.Resolve <World>(); var entity = new Character { Id = "test_entity", Names = "test entity", ShortDescr = "test entity" }; var data = EntitySerializer.Serialize(entity); Assert.AreEqual("test_entity", data["Vnum"], "Vnum"); Assert.AreEqual("test entity", data["Names"], "Names"); Assert.AreEqual("test entity", data["ShortDescr"], "ShortDescr"); }
public static void Configure(IGlobalConfiguration httpConfiguration, IAppBuilder app) { var container = UnityConfigurator.GetConfiguredContainer(); httpConfiguration.UseActivator(new ContainerJobActivator(container)); app.UseHangfireAspNet(GetHangfireServers); if (AppSettingsService.Environment.IsDev()) { // If we are in Dev, always allow Hangfire access. app.UseHangfireDashboard("/hangfire"); } else { app.UseHangfireDashboard("/hangfire", new DashboardOptions { Authorization = new[] { new InventAppHangfireDashboardAuthorizationFilter() } }); } }
public void TestFixtureSetUp() { UnityConfigurator.Configure(); _attack = AspectFactory.Attack(); _attack.SetAssaulterWeaponBaseDamage(22); _attack.AddAssaulterStrength(22); _attack.AddAssaulterIntellect(20); _attack.AddAssaulterDexterety(21); _attack.AddAssaulterAttack(20); _attack.AddAssaulterMagicAttack(0); _attack.AddAssaulterAccuracy(20); _attack.AddAssaulterCriticalChance(15); _attack.AddDefenderArmor(15); _attack.AddDefenderMagicArmor(0); _attack.AddDefenderEvasion(25); _attack.AddDefenderConstitution(22); _attack.AddDefenderWisdom(21); }
public void SetUp() { UnityConfigurator.Configure(); }
public virtual void FixtureSetup() { Launcher.InitializeML(); UnityConfigurator.Configure(); }