CreateValidExampleWebApplication() public static method

Creates a valid example web application structure in a random directory and returns the path to the directory.
public static CreateValidExampleWebApplication ( ) : string
return string
Example #1
0
        public void BootstrapsWebApplicationConfigFileChange()
        {
            string           path   = ApplicationUtils.CreateValidExampleWebApplication();
            ManualResetEvent handle = new ManualResetEvent(false);

            try
            {
                using (Bootstraps bootstraps = new Bootstraps(path, null, 500))
                {
                    bootstraps.ApplicationFilesChanged += (sender, e) =>
                    {
                        Assert.AreEqual(Path.Combine(path, "Web.config"), e.FullPath);
                        handle.Set();
                    };

                    Assert.AreEqual(BootstrapsPullupResultType.Success, bootstraps.PullUp().ResultType);

                    using (File.Create(Path.Combine(path, "Web.config")))
                    {
                    }

                    WaitHandle.WaitAll(new WaitHandle[] { handle });
                }
            }
            finally
            {
                handle.Close();
            }
        }
Example #2
0
        public void BootstrapsWebApplicationBinFileChange()
        {
            string           path     = ApplicationUtils.CreateValidExampleWebApplication();
            string           binPath  = Path.Combine(path, "bin");
            string           filePath = Path.Combine(binPath, Path.GetFileNameWithoutExtension(Path.GetRandomFileName()) + ".dll");
            ManualResetEvent handle   = new ManualResetEvent(false);

            try
            {
                using (Bootstraps bootstraps = new Bootstraps(path, null, 500))
                {
                    bootstraps.ApplicationFilesChanged += (sender, e) =>
                    {
                        Assert.AreEqual(filePath, e.FullPath);
                        handle.Set();
                    };

                    Assert.AreEqual(BootstrapsPullupResultType.Success, bootstraps.PullUp().ResultType);

                    using (File.Create(filePath))
                    {
                    }

                    WaitHandle.WaitAll(new WaitHandle[] { handle });
                }
            }
            finally
            {
                handle.Close();
            }
        }
Example #3
0
        public void BootstrapsPullUpBasicWebApplication()
        {
            string path = ApplicationUtils.CreateValidExampleWebApplication();

            using (Bootstraps bootstraps = new Bootstraps(path, null, 500))
            {
                Assert.AreEqual(BootstrapsPullupResultType.Success, bootstraps.PullUp().ResultType);
                Assert.IsTrue(bootstraps.IsLoaded);
            }
        }
Example #4
0
        public void BootstrapsWebApplicationAssembliesNotLocked()
        {
            string path = ApplicationUtils.CreateValidExampleWebApplication();

            AssembliesNotLocked(path, Path.Combine(Path.Combine(path, "bin"), "BlueCollar.dll"));
        }