@@ -6,7 +6,7 @@ open MinCostStringConversion
6
6
7
7
[<TestClass>]
8
8
type MinCostStringConversionTests () =
9
-
9
+
10
10
let validateAndApply ( source : string ) ( operations : Operation array ) : string =
11
11
operations
12
12
|> Array.mapFold ( fun sourcePosition op ->
@@ -27,7 +27,7 @@ type MinCostStringConversionTests () =
27
27
|> Array.choose id
28
28
|> Array.map string
29
29
|> String.concat " "
30
-
30
+
31
31
let calculateCost ( operations : Operation array , copyCost : int , replaceCost : int , deleteCost : int , insertCost : int ) =
32
32
operations
33
33
|> Array.sumBy ( function
@@ -36,8 +36,8 @@ type MinCostStringConversionTests () =
36
36
| Operation.Delete _ -> deleteCost
37
37
| Operation.Insert _ -> insertCost
38
38
)
39
-
40
-
39
+
40
+
41
41
[<TestMethod>]
42
42
[<DataRow( " " , " " , 1 , 2 , 3 , 4 ) >]
43
43
[<DataRow( " github" , " " , 1 , 2 , 3 , 4 ) >]
@@ -48,7 +48,7 @@ type MinCostStringConversionTests () =
48
48
[<DataRow( " banana" , " apple" , 3 , 1 , 2 , 4 ) >]
49
49
member this.validateResult ( source : string , destination : string , copyCost : int , replaceCost : int , deleteCost : int , insertCost : int ) =
50
50
let costs , ops = computeTransformTables ( source, destination, copyCost, replaceCost, deleteCost, insertCost)
51
-
51
+
52
52
for i = 0 to source.Length do
53
53
for j = 0 to destination.Length do
54
54
let sourceSubstring = source.Substring( 0 , i)
@@ -58,7 +58,7 @@ type MinCostStringConversionTests () =
58
58
let calculatedCost = calculateCost ( operations, copyCost, replaceCost, deleteCost, insertCost)
59
59
Assert.AreEqual ( destinationSubstring, actualDestinationSubstring)
60
60
Assert.AreEqual ( costs.[ i].[ j], calculatedCost)
61
-
61
+
62
62
static member inputForComputeTransformTables =
63
63
seq {
64
64
yield [|
@@ -96,6 +96,6 @@ type MinCostStringConversionTests () =
96
96
member this.computeTransformTables ( sourceString : string , destinationString : string , copyCost : int , replaceCost : int , deleteCost : int , insertCost : int , expected : int array array * Operation array array ) =
97
97
let actual = MinCostStringConversion.computeTransformTables( sourceString, destinationString, copyCost, replaceCost, deleteCost, insertCost)
98
98
Assert.IsTrue(( expected = actual))
99
-
100
-
99
+
100
+
101
101
0 commit comments