public void GetVersionReturnsV1IfCshtmlFilePresentButNoVersionIsSpecifiedInConfigOrBin()
        {
            AppDomainUtils.RunInSeparateAppDomain(
                () =>
            {
                // Arrange - Load v2 Config
                Assembly asm = Assembly.LoadFrom(
                    Path.Combine(
                        _tempPath,
                        @"ConfigTestAssemblies\V2_Signed\System.Web.WebPages.Deployment.dll"
                        )
                    );
                Assert.Equal(new Version(2, 0, 0, 0), asm.GetName().Version);
                Assert.Equal("System.Web.WebPages.Deployment", asm.GetName().Name);

                using (WebUtils.CreateHttpRuntime(@"~\foo", "."))
                {
                    string path = Path.Combine(
                        _tempPath,
                        @"ConfigTestSites\CshtmlFileNoVersion"
                        );

                    // Act
                    Version ver             = WebPagesDeployment.GetVersionWithoutEnabledCheck(path);
                    Version explicitVersion = WebPagesDeployment.GetExplicitWebPagesVersion(
                        path
                        );

                    // Assert
                    Assert.Equal(new Version("1.0.0.0"), ver);
                    Assert.Null(explicitVersion);
                }
            }
                );
        }
        public void GetVersionReturnsLowerVersionIfSpecifiedInConfigAndNotExplicitlyDisabled()
        {
            AppDomainUtils.RunInSeparateAppDomain(
                () =>
            {
                // Arrange - Load v2 Config
                Assembly asm = Assembly.LoadFrom(
                    Path.Combine(
                        _tempPath,
                        @"ConfigTestAssemblies\V2_Signed\System.Web.WebPages.Deployment.dll"
                        )
                    );
                Assert.Equal(new Version(2, 0, 0, 0), asm.GetName().Version);
                Assert.Equal("System.Web.WebPages.Deployment", asm.GetName().Name);

                using (WebUtils.CreateHttpRuntime(@"~\foo", "."))
                {
                    string path = Path.Combine(_tempPath, @"ConfigTestSites\NoCshtmlConfigV1");

                    // Act
                    Version ver             = WebPagesDeployment.GetVersionWithoutEnabledCheck(path);
                    Version explicitVersion = WebPagesDeployment.GetExplicitWebPagesVersion(
                        path
                        );

                    // Assert
                    Assert.Equal(new Version(1, 0, 0, 0), ver);
                    Assert.Equal(new Version(1, 0, 0, 0), explicitVersion);
                }
            }
                );
        }