Simplify Example
This commit is contained in:
parent
9ff53f1803
commit
de5843a783
4 changed files with 5 additions and 5 deletions
4
Example/Calculator.fs
Normal file
4
Example/Calculator.fs
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
namespace Example
|
||||
|
||||
module Calculator =
|
||||
let addOne value = value + 1
|
||||
21
Example/CalculatorTests.fs
Normal file
21
Example/CalculatorTests.fs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
namespace Example
|
||||
|
||||
open Example
|
||||
open Mutannot
|
||||
open Xunit
|
||||
|
||||
type CalculatorTests() =
|
||||
[<Fact>]
|
||||
[<MutationCase("""
|
||||
diff --git a/Example/Calculator.fs b/Example/Calculator.fs
|
||||
index 6f0c515..030e391 100644
|
||||
--- a/Example/Calculator.fs
|
||||
+++ b/Example/Calculator.fs
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Example
|
||||
|
||||
module Calculator =
|
||||
- let addOne value = value + 1
|
||||
+ let addOne value = value - 1
|
||||
""")>]
|
||||
member _.AddOne_increments() = Assert.Equal(42, Calculator.addOne 41)
|
||||
21
Example/Example.fsproj
Normal file
21
Example/Example.fsproj
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="MutationCaseAttribute.fs" />
|
||||
<Compile Include="Calculator.fs" />
|
||||
<Compile Include="CalculatorTests.fs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
|
||||
<PackageReference Include="xunit" Version="2.9.3" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
9
Example/MutationCaseAttribute.fs
Normal file
9
Example/MutationCaseAttribute.fs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
namespace Mutannot
|
||||
|
||||
open System
|
||||
|
||||
[<AttributeUsage(AttributeTargets.Method, AllowMultiple = true)>]
|
||||
type MutationCaseAttribute(patch: string) =
|
||||
inherit Attribute()
|
||||
|
||||
member _.Patch = patch
|
||||
Loading…
Add table
Add a link
Reference in a new issue