コード例 #1
0
    public void TogglesExistingValue()
    {
        var convertedProjFile = ProjectFileTextEditor.WithUpdatedDefaultItemExcludes(
            @"
  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**;$(ProjectDir)**\*.cs</DefaultItemExcludes>
    <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
  </PropertyGroup>", "cs", "vb");

        Assert.Equal(Utils.HomogenizeEol(@"
  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**;$(ProjectDir)**\*.vb</DefaultItemExcludes>
    <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
  </PropertyGroup>"),
                     Utils.HomogenizeEol(convertedProjFile));
    }
コード例 #2
0
    public void InsertsIfNotPresent()
    {
        var convertedProjFile = ProjectFileTextEditor.WithUpdatedDefaultItemExcludes(
            @"
  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
  </PropertyGroup>
  <PropertyGroup>
    <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
  </PropertyGroup>", "cs", "vb");

        Assert.Equal(Utils.HomogenizeEol(@"
  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <DefaultItemExcludes>$(DefaultItemExcludes);$(ProjectDir)**\*.vb</DefaultItemExcludes>
  </PropertyGroup>
  <PropertyGroup>
    <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
  </PropertyGroup>"),
                     Utils.HomogenizeEol(convertedProjFile));
    }