<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->


<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:lux="http://schemas.microsoft.com/wix/2009/Lux">
  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLFOLDER" Name="Mutations" />
      </Directory>
    </Directory>
  </Fragment>
  
  <Fragment>
    <CustomAction Id="TestCustomActionSimple" Property="SIMPLE" Value="[INSTALLFOLDER]" />
    <CustomAction Id="TestCustomActionSimpleNumber" Property="SIMPLENUMBER" Value="1" />
    <CustomAction Id="TestCustomActionMultiValue" Property="MULTIVALUE" Value="1*[INSTALLFOLDER]*WIXEAST" />
    <CustomAction Id="TestCustomActionNameValuePairs" Property="NAMEVALUEPAIRS" Value="InstallationRoot#[INSTALLFOLDER]#Developers#WIXEAST" />

    <InstallExecuteSequence>
      <Custom Action="TestCustomActionSimple" After="InstallFiles" />
      <Custom Action="TestCustomActionSimpleNumber" After="TestCustomActionSimple" />
      <Custom Action="TestCustomActionMultiValue" After="TestCustomActionSimpleNumber" />
      <Custom Action="TestCustomActionNameValuePairs" Before="InstallFinalize" />
    </InstallExecuteSequence>
  </Fragment>

  <Fragment>
    <!-- mutation-free -->
    <lux:UnitTest CustomAction="TestCustomActionSimple" Property="SIMPLE" Value="[INSTALLFOLDER]" Operator="equal" />
    <lux:UnitTest CustomAction="TestCustomActionSimpleNumber" Property="SIMPLENUMBER" Value="1" />

    <lux:Mutation Id="SimulateDiskFull">
      <lux:UnitTest Id="DiskFullSimple" CustomAction="TestCustomActionSimple" Property="SIMPLE" Value="[INSTALLFOLDER]" Operator="equal" />
      <lux:UnitTest Id="DiskFullSimpleNumber" CustomAction="TestCustomActionSimpleNumber" Property="SIMPLENUMBER" Value="1" />
    </lux:Mutation>
    
    <lux:Mutation Id="SimulateUpgrade">
      <lux:UnitTest CustomAction="TestCustomActionMultiValue" Property="MULTIVALUE" ValueSeparator="*">
        <lux:Condition>VersionNT</lux:Condition>
        <!-- intentional failure -->
        <lux:UnitTest Index="0" Value="INTENTIONAL_FAILURE" /> 
        <lux:UnitTest Index="1" Value="[INSTALLFOLDER]">
          <lux:Condition>NOT Installed</lux:Condition>
        </lux:UnitTest>
        <lux:UnitTest Index="2" Value="WIXEAST" /> 
      </lux:UnitTest>
    </lux:Mutation>
    
    <lux:Mutation Id="SimulateUpgradeFailure">
      <lux:UnitTest CustomAction="TestCustomActionNameValuePairs" Property="NAMEVALUEPAIRS" NameValueSeparator="#">
        <lux:UnitTest Index="InstallationRoot" Value="[INSTALLFOLDER]" />
        <lux:UnitTest Index="Developers" Operator="caseInsensitiveNotEqual" Value="WIXWEST" />
      </lux:UnitTest>
    </lux:Mutation>
  </Fragment>
</Wix>
