Ejemplo n.º 1
0
        public void API_Cassini_Ctors()
        {
            //() ctor
            var cassini_Default = new API_Cassini();

            Assert.IsNotNull(cassini_Default);
            Assert.IsTrue(cassini_Default.CassiniServer.PhysicalPath.dirExists());
            Assert.Less(20000, cassini_Default.CassiniServer.Port);
            Assert.AreEqual("/", cassini_Default.CassiniServer.VirtualPath);

            //(string physicalPath) ctor
            var physicalPath         = @"C:\a_path\".add_RandomLetters(10) + "\\";
            var cassini_PhysicalPath = new API_Cassini(physicalPath);

            Assert.IsNotNull(cassini_PhysicalPath);
            Assert.IsFalse(cassini_PhysicalPath.CassiniServer.PhysicalPath.dirExists());
            Assert.AreEqual(cassini_PhysicalPath.CassiniServer.PhysicalPath, physicalPath);
            Assert.Less(20000, cassini_PhysicalPath.CassiniServer.Port);
            Assert.AreEqual("/", cassini_PhysicalPath.CassiniServer.VirtualPath);

            //(string physicalPath, string virtualPath, int port) ctor
            var port              = 12345;
            var virtualPath       = "/".add_RandomLetters(10);
            var cassini_AllValues = new API_Cassini(physicalPath, virtualPath, port);

            Assert.IsNotNull(cassini_AllValues);
            Assert.IsFalse(cassini_AllValues.CassiniServer.PhysicalPath.dirExists());
            Assert.AreEqual(cassini_AllValues.CassiniServer.PhysicalPath, physicalPath);
            Assert.AreEqual(cassini_AllValues.CassiniServer.Port, port);
            Assert.AreEqual(cassini_AllValues.CassiniServer.VirtualPath, virtualPath);

            //delete site folder
            cassini_Default.PhysicalPath.delete_Folder();
            cassini_PhysicalPath.PhysicalPath.delete_Folder();
        }
Ejemplo n.º 2
0
        public void start()
        {
            var cassini          = new API_Cassini();
            var port             = cassini.port();
            var url              = cassini.url();
            var port_BeforeStart = port.tcpClient();

            cassini.start();
            var port_AfterStart = port.tcpClient();
            var html            = url.get_Html();

            cassini.stop();
            var port_AfterStop = port.tcpClient();

            Assert.Less(0, port);
            Assert.IsNull(port_BeforeStart);
            Assert.IsNotNull(port_AfterStart);
            Assert.IsNull(port_AfterStop);
            Assert.IsNotNull(url);
            Assert.IsTrue(html.valid());
            Assert.IsTrue(html.contains("Directory Listing"));

            //test null data
            Assert.IsNull((null as API_Cassini).start());

            //delete site folder
            cassini.PhysicalPath.delete_Folder();
        }
Ejemplo n.º 3
0
        [Test] public void teamMentor_Objects_Proxy()
        {
            var nUnitTests_Cassini = new NUnitTests_Cassini_TeamMentor();
            var apiCassini         = new API_Cassini();

            nUnitTests_Cassini.apiCassini = apiCassini;

            nUnitTests_Cassini.teamMentor_Objects_Proxy().assert_Not_Null()
            .apiCassini.assert_Is(apiCassini);
        }
        public static ascx_Simple_Script_Editor script_Cassini(this API_Cassini api_Cassini, bool startHidden = false)
        {
            api_Cassini.url().assert_Not_Null()
            .uri().GET();

            var extraCode = @"
//using FluentSharp.CassiniDev
//O2Ref:FluentSharp.CassiniDev.dll
";

            return(api_Cassini.script_Me("cassini", startHidden)
                   .code_Append(extraCode));
        }
Ejemplo n.º 5
0
        public void start()
        {
            apiCassini.assert_Null();
            webRoot.assert_Folder_Not_Exists();
            port.assert_Default();

            apiCassini = new API_Cassini();
            webRoot    = apiCassini.webRoot();
            port       = apiCassini.port();


            webRoot.assert_Folder_Exists();
            port.tcpClient().assert_Null();
            apiCassini.start();
            port.tcpClient().assert_Not_Null();
        }
Ejemplo n.º 6
0
        public virtual void testFixtureSetUp()
        {
            webRoot           = this.teamMentor_Root_OnDisk().assert_Folder_Exists();   // this points to a folder with the full TM
            path_XmlLibraries = "path_XmlLibraries".tempDir().assert_Folder_Exists();   // this points to a temp folder

            apiCassini = new API_Cassini(webRoot).assert_Not_Null();
            port       = apiCassini.port().assert_Not_Default();
            siteUri    = apiCassini.url().uri();

            apiCassini.webRoot().assert_Equal_To(webRoot);

            port.tcpClient().assert_Null();
            apiCassini.start();

            this.tmProxy().set_Custom_Path_XmlDatabase(path_XmlLibraries);              // configure TM to the temp path_XmlLibraries folder for all files created
        }
Ejemplo n.º 7
0
        public static void Main()
        {
            var server = new Server("test".tempDir());
            var host   = server.invoke("GetHost");


            var cassini = new API_Cassini();

            cassini.start();
            var browser = "FluentSharp.AspNet_Mvc".popupWindow()
                          .add_WebBrowser()
                          .add_NavigationBar();

            browser.open(cassini.url());
            browser.waitForClose();
            cassini.stop();
        }
        public static ascx_Simple_Script_Editor script_IE(this API_Cassini api_Cassini)
        {
            api_Cassini.url().assert_Not_Null()
            .uri().GET();

            var extraCode = @"
//using FluentSharp.CassiniDev
//O2Ref:FluentSharp.CassiniDev.dll
";


            var scriptEditor = "Cassini Dev Test".add_IE_PopupWindow()
                               .open(api_Cassini.url())
                               .script_IE();

            scriptEditor.add_InvocationParameter("cassini", api_Cassini)
            .code_Append(extraCode);
            return(scriptEditor);
        }
Ejemplo n.º 9
0
        public void Browser_Website()
        {
            var cassini = new API_Cassini();

            cassini.start();
            var browser = "FluentSharp - Test side".popupWindow().add_WebBrowser();

            browser.html().assert_Empty();

            browser.open(cassini.url()).waitForCompleted();


            browser.html().assert_Not_Empty()
            .assert_Contains("Directory Listing");

            //delete site folder
            cassini.PhysicalPath.delete_Folder();
            browser.closeForm();
        }
Ejemplo n.º 10
0
        public void Get_Controller_Via_Cassini()
        {
            var server = new API_Cassini(webRoot);

            server.start();

            var testUrl  = server.url() + "Test";
            var html     = testUrl.html();
            var expected = "Razor Page Test";


            Assert.IsTrue(html.contains(expected));

            /*"view site".popupWindow()
             *         .add_WebBrowser_with_NavigationBar()
             *         .open(server.url())
             *         .waitForClose();
             */
            server.stop();
        }
Ejemplo n.º 11
0
 public TM_Proxy(API_Cassini apiCassini)
 {
     this.apiCassini = apiCassini;
     o2Proxy         = apiCassini.appDomain().o2Proxy();
 }
Ejemplo n.º 12
0
        [SetUp] public void setup()
        {
            apiCassini = new API_Cassini();

            apiCassini.webRoot().assert_Folder_Empty();
        }
Ejemplo n.º 13
0
 public void setup()
 {
     api_Cassini = new API_Cassini();
     api_Cassini.start();
 }
 public static API_Cassini script_Cassini_WaitForClose(this API_Cassini api_Cassini)
 {
     api_Cassini.script_Cassini().waitForClose();
     return(api_Cassini);
 }