예제 #1
0
        public void ShouldBeAbleToSetProxyAliases()
        {
            BamServer server = CreateServer("Test_"._Format(MethodBase.GetCurrentMethod().Name));
            BamConf   conf   = new BamConf();

            conf.AddProxyAlias("Test", typeof(TestResponder));
            Expect.AreEqual(1, conf.ProxyAliases.Length);
            server.SetConf(conf);
            Expect.IsTrue(server.ProxyAliases.Length == 1);

            Expect.AreEqual(server.ProxyAliases[0].ClassName, typeof(TestResponder).Name);
        }
예제 #2
0
        public void TemplateInitializerShouldBeCalled()
        {
            BamServer server = CreateServer("{0}_Content"._Format(MethodBase.GetCurrentMethod().Name));
            BamConf   conf   = new BamConf();

            conf.InitializeTemplates = true;
            server.SetConf(conf);
            server.SaveConf(true);
            TestTemplateInitializer testInitializer = new TestTemplateInitializer(server);

            server.TemplateInitializer = testInitializer;
            Expect.IsFalse(testInitializer.InitializeCalled);
            server.Start();
            Expect.IsTrue(testInitializer.InitializeCalled);
            server.Stop();
        }
예제 #3
0
        public void SettingConfigShouldReflectInServerSettings()
        {
            BamServer server = CreateServer("{0}_Content"._Format(MethodBase.GetCurrentMethod().Name));
            BamConf   conf   = new BamConf()
            {
                GenerateDao = true,
            };

            server.GenerateDao = false;

            Expect.IsFalse(server.GenerateDao);

            Expect.IsTrue(conf.GenerateDao);

            server.SetConf(conf);

            Expect.IsTrue(server.GenerateDao);
        }