コード例 #1
0
        public IDocumentStore NewDocumentStore(bool fiddler = false, Dictionary <string, string> settings = null)
        {
            if (iisExpress == null)
            {
                iisExpress = new IISExpressDriver();
                var iisTestWebDirectory = DeployWebProjectToTestDirectory();

                if (settings != null)
                {
                    ModifyWebConfig(Path.Combine(iisTestWebDirectory, "web.config"), settings);
                }

                iisExpress.Start(iisTestWebDirectory, 8084);
            }

            var url = iisExpress.Url;

            if (fiddler)
            {
                url = url.Replace("localhost", "localhost.fiddler");
            }
            return(new DocumentStore {
                Url = url
            }.Initialize());
        }
コード例 #2
0
        public void Dispose()
        {
            if (iisExpress != null)
            {
                iisExpress.Dispose();
                iisExpress = null;
            }

            IOExtensions.DeleteDirectory(Path.GetFullPath(WebDirectory));
        }
コード例 #3
0
        public IDocumentStore NewDocumentStore(bool fiddler = false, Dictionary<string, string> settings = null)
        {
            if (iisExpress == null)
            {
                iisExpress = new IISExpressDriver();
                var iisTestWebDirectory = DeployWebProjectToTestDirectory();

                if (settings != null)
                {
                    ModifyWebConfig(Path.Combine(iisTestWebDirectory, "web.config"), settings);
                }

                iisExpress.Start(iisTestWebDirectory, 8084);
            }

            var url = iisExpress.Url;
            if (fiddler)
                url = url.Replace("localhost", "localhost.fiddler");
            return new DocumentStore {Url = url}.Initialize();
        }
コード例 #4
0
ファイル: WebTestFixture.cs プロジェクト: j2jensen/ravendb
        public WebTestFixture()
        {
            if (IsIisExpressInstalled() == false)
                return;

            try
            {
                path = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
                var from = Path.GetFullPath("../");

                IOExtensions.CopyDirectory(from, path);

                iisExpressDriver = new IISExpressDriver();
                iisExpressDriver.Start(path, Port);
            }
            catch (Exception)
            {
                IOExtensions.DeleteDirectory(path);

                throw;
            }
        }
コード例 #5
0
        public void Dispose()
        {
            if (iisExpress != null)
            {
                iisExpress.Dispose();
                iisExpress = null;
            }

            IOExtensions.DeleteDirectory(Path.GetFullPath(WebDirectory));
        }