Extend tests with semi private pocket
MODIFY
WalletWasabi.Tests/UnitTests/UserInterfaceTest/PocketSelectionTests.cs
WalletWasabi.Tests/UnitTests/UserInterfaceTest/PocketSelectionTests.cs
@@ -272,13 +272,14 @@ public class PocketSelectionTests
}
[Fact]
- public void PrivatePocketIsHidden()
+ public void PrivateAndSemiPrivatePocketsAreHidden()
{
var selection = new LabelSelectionViewModel(Money.Parse("1.0"));
var pockets = new List<Pocket>();
pockets.AddPocket(1.0M, out var pocket1, CoinPocketHelper.PrivateFundsText);
pockets.AddPocket(2.0M, out var pocket2, "Dan");
+ pockets.AddPocket(1.0M, out var pocket3, CoinPocketHelper.SemiPrivateFundsText);
selection.Reset(pockets.ToArray());
@@ -286,6 +287,7 @@ public class PocketSelectionTests
// Not found.
Assert.Throws<InvalidOperationException>(() => selection.GetLabel(CoinPocketHelper.PrivateFundsText));
+ Assert.Throws<InvalidOperationException>(() => selection.GetLabel(CoinPocketHelper.SemiPrivateFundsText));
}
[Fact]
@@ -296,6 +298,7 @@ public class PocketSelectionTests
var pockets = new List<Pocket>();
pockets.AddPocket(1.0M, out var pocket1, CoinPocketHelper.PrivateFundsText);
pockets.AddPocket(2.0M, out var pocket2, "Dan");
+ pockets.AddPocket(1.0M, out var pocket3, CoinPocketHelper.SemiPrivateFundsText);
selection.Reset(pockets.ToArray());
@@ -306,6 +309,7 @@ public class PocketSelectionTests
var output = selection.GetUsedPockets();
Assert.DoesNotContain(pocket2, output);
+ Assert.DoesNotContain(pocket3, output);
Assert.Contains(pocket1, output);
}
@@ -317,6 +321,7 @@ public class PocketSelectionTests
var pockets = new List<Pocket>();
pockets.AddPocket(1.0M, out var pocket1, CoinPocketHelper.PrivateFundsText);
pockets.AddPocket(2.0M, out var pocket2, "Dan");
+ pockets.AddPocket(1.0M, out var pocket3, CoinPocketHelper.SemiPrivateFundsText);
selection.Reset(pockets.ToArray());
@@ -326,6 +331,7 @@ public class PocketSelectionTests
var output = selection.GetUsedPockets();
Assert.DoesNotContain(pocket1, output);
Assert.Contains(pocket2, output);
+ Assert.DoesNotContain(pocket3, output);
}
[Fact]
@@ -336,6 +342,7 @@ public class PocketSelectionTests
var pockets = new List<Pocket>();
pockets.AddPocket(1.0M, out var pocket1, CoinPocketHelper.PrivateFundsText);
pockets.AddPocket(2.0M, out var pocket2, "Dan");
+ pockets.AddPocket(1.0M, out var pocket3, CoinPocketHelper.SemiPrivateFundsText);
selection.Reset(pockets.ToArray());
@@ -344,6 +351,7 @@ public class PocketSelectionTests
var output = selection.GetUsedPockets();
Assert.Contains(pocket1, output);
Assert.Contains(pocket2, output);
+ Assert.DoesNotContain(pocket3, output);
}
[Fact]
@@ -405,6 +413,7 @@ public class PocketSelectionTests
pockets.AddPocket(0.7M, out var pocket1, CoinPocketHelper.PrivateFundsText);
pockets.AddPocket(0.6M, out var pocket2, "Dan");
pockets.AddPocket(0.7M, out var pocket3, CoinPocketHelper.UnlabelledFundsText);
+ pockets.AddPocket(0.7M, out var pocket4, CoinPocketHelper.SemiPrivateFundsText);
selection.Reset(pockets.ToArray());
@@ -412,6 +421,7 @@ public class PocketSelectionTests
Assert.Contains(pocket1, output);
Assert.DoesNotContain(pocket2, output);
Assert.DoesNotContain(pocket3, output);
+ Assert.DoesNotContain(pocket4, output);
}
[Fact]
@@ -427,6 +437,7 @@ public class PocketSelectionTests
pockets.AddPocket(0.15M, out var pocket5, "David");
pockets.AddPocket(0.2M, out var pocket6, "Lucas");
pockets.AddPocket(0.3M, out var pocket7, "David", "Lucas", "Dan");
+ pockets.AddPocket(0.1M, out var pocket8, CoinPocketHelper.SemiPrivateFundsText);
selection.Reset(pockets.ToArray());
@@ -438,6 +449,7 @@ public class PocketSelectionTests
Assert.Contains(pocket5, output);
Assert.Contains(pocket6, output);
Assert.Contains(pocket7, output);
+ Assert.DoesNotContain(pocket8, output);
}
[Fact]
@@ -449,6 +461,7 @@ public class PocketSelectionTests
pockets.AddPocket(0.5M, out var pocket1, CoinPocketHelper.PrivateFundsText);
pockets.AddPocket(0.5M, out var pocket2, "Dan");
pockets.AddPocket(0.8M, out var pocket3, CoinPocketHelper.UnlabelledFundsText);
+ pockets.AddPocket(0.1M, out var pocket4, CoinPocketHelper.SemiPrivateFundsText);
selection.Reset(pockets.ToArray());
@@ -456,6 +469,7 @@ public class PocketSelectionTests
Assert.DoesNotContain(pocket1, output);
Assert.DoesNotContain(pocket2, output);
Assert.Contains(pocket3, output);
+ Assert.DoesNotContain(pocket4, output);
}
[Fact]
@@ -467,6 +481,7 @@ public class PocketSelectionTests
pockets.AddPocket(0.5M, out var pocket1, CoinPocketHelper.PrivateFundsText);
pockets.AddPocket(0.5M, out var pocket2, "Dan");
pockets.AddPocket(0.8M, out var pocket3, CoinPocketHelper.UnlabelledFundsText);
+ pockets.AddPocket(0.4M, out var pocket4, CoinPocketHelper.SemiPrivateFundsText);
selection.Reset(pockets.ToArray());
@@ -474,6 +489,7 @@ public class PocketSelectionTests
Assert.DoesNotContain(pocket1, output);
Assert.Contains(pocket2, output);
Assert.Contains(pocket3, output);
+ Assert.DoesNotContain(pocket4, output);
}
[Fact]
@@ -485,6 +501,7 @@ public class PocketSelectionTests
pockets.AddPocket(0.8M, out var pocket1, CoinPocketHelper.PrivateFundsText);
pockets.AddPocket(0.5M, out var pocket2, "Dan");
pockets.AddPocket(0.4M, out var pocket3, CoinPocketHelper.UnlabelledFundsText);
+ pockets.AddPocket(0.1M, out var pocket4, CoinPocketHelper.SemiPrivateFundsText);
selection.Reset(pockets.ToArray());
@@ -492,6 +509,7 @@ public class PocketSelectionTests
Assert.Contains(pocket1, output);
Assert.Contains(pocket2, output);
Assert.DoesNotContain(pocket3, output);
+ Assert.DoesNotContain(pocket4, output);
}
[Fact]
@@ -503,6 +521,7 @@ public class PocketSelectionTests
pockets.AddPocket(0.8M, out var pocket1, CoinPocketHelper.PrivateFundsText);
pockets.AddPocket(0.1M, out var pocket2, "Dan");
pockets.AddPocket(0.5M, out var pocket3, CoinPocketHelper.UnlabelledFundsText);
+ pockets.AddPocket(0.05M, out var pocket4, CoinPocketHelper.SemiPrivateFundsText);
selection.Reset(pockets.ToArray());
@@ -510,17 +529,19 @@ public class PocketSelectionTests
Assert.Contains(pocket1, output);
Assert.DoesNotContain(pocket2, output);
Assert.Contains(pocket3, output);
+ Assert.DoesNotContain(pocket4, output);
}
[Fact]
public void AutoSelectAllPockets()
{
- var selection = new LabelSelectionViewModel(Money.Parse("1.5"));
+ var selection = new LabelSelectionViewModel(Money.Parse("2.0"));
var pockets = new List<Pocket>();
pockets.AddPocket(0.8M, out var pocket1, CoinPocketHelper.PrivateFundsText);
pockets.AddPocket(0.3M, out var pocket2, "Dan");
pockets.AddPocket(0.5M, out var pocket3, CoinPocketHelper.UnlabelledFundsText);
+ pockets.AddPocket(0.5M, out var pocket4, CoinPocketHelper.SemiPrivateFundsText);
selection.Reset(pockets.ToArray());
@@ -528,6 +549,7 @@ public class PocketSelectionTests
Assert.Contains(pocket1, output);
Assert.Contains(pocket2, output);
Assert.Contains(pocket3, output);
+ Assert.Contains(pocket4, output);
}
[Fact]
@@ -543,6 +565,7 @@ public class PocketSelectionTests
pockets.AddPocket(1.1M, out var pocket5, "David");
pockets.AddPocket(1.1M, out var pocket6, "Lucas");
pockets.AddPocket(1.1M, out var pocket7, "David", "Lucas", "Dan");
+ pockets.AddPocket(1.0M, out var pocket8, CoinPocketHelper.SemiPrivateFundsText);
selection.Reset(pockets.ToArray());
@@ -554,6 +577,7 @@ public class PocketSelectionTests
Assert.DoesNotContain(pocket5, output);
Assert.DoesNotContain(pocket6, output);
Assert.DoesNotContain(pocket7, output);
+ Assert.DoesNotContain(pocket8, output);
}
[Fact]
@@ -586,6 +610,7 @@ public class PocketSelectionTests
pockets.AddPocket(1.1M, out var pocket2, "Dan");
pockets.AddPocket(1.5M, out var pocket3, CoinPocketHelper.UnlabelledFundsText);
pockets.AddPocket(1.1M, out var pocket4, "David", "Lucas");
+ pockets.AddPocket(0.1M, out var pocket5, CoinPocketHelper.SemiPrivateFundsText);
selection.Reset(pockets.ToArray());
@@ -594,6 +619,7 @@ public class PocketSelectionTests
Assert.DoesNotContain(pocket2, output);
Assert.DoesNotContain(pocket3, output);
Assert.Contains(pocket4, output);
+ Assert.DoesNotContain(pocket5, output);
}
[Fact]
@@ -610,6 +636,7 @@ public class PocketSelectionTests
pockets.AddPocket(1.1M, out var pocket6, "Lucas");
pockets.AddPocket(1.1M, out var pocket7, "David", "Lucas", "Dan", "Roland");
pockets.AddPocket(1.1M, out var pocket8, "David", "Dan");
+ pockets.AddPocket(0.1M, out var pocket9, CoinPocketHelper.SemiPrivateFundsText);
selection.Reset(pockets.ToArray());
@@ -622,6 +649,7 @@ public class PocketSelectionTests
Assert.DoesNotContain(pocket6, output);
Assert.DoesNotContain(pocket7, output);
Assert.DoesNotContain(pocket8, output);
+ Assert.DoesNotContain(pocket9, output);
}
[Fact]
@@ -638,6 +666,7 @@ public class PocketSelectionTests
pockets.AddPocket(0.5M, out var pocket6, "Lucas");
pockets.AddPocket(0.5M, out var pocket7, "David", "Lucas", "Dan", "Roland");
pockets.AddPocket(0.5M, out var pocket8, "David", "Dan");
+ pockets.AddPocket(0.1M, out var pocket9, CoinPocketHelper.SemiPrivateFundsText);
selection.Reset(pockets.ToArray());
@@ -650,6 +679,7 @@ public class PocketSelectionTests
Assert.DoesNotContain(pocket6, output);
Assert.DoesNotContain(pocket7, output);
Assert.DoesNotContain(pocket8, output);
+ Assert.DoesNotContain(pocket9, output);
}
[Fact]
@@ -664,6 +694,7 @@ public class PocketSelectionTests
pockets.AddPocket(0.4M, out var pocket4, "David");
pockets.AddPocket(0.4M, out var pocket5, "David", "Max");
pockets.AddPocket(0.6M, out var pocket6, "David", "Lucas", "Dan");
+ pockets.AddPocket(0.1M, out var pocket7, CoinPocketHelper.SemiPrivateFundsText);
selection.Reset(pockets.ToArray());
@@ -674,6 +705,7 @@ public class PocketSelectionTests
Assert.Contains(pocket4, output);
Assert.DoesNotContain(pocket5, output);
Assert.Contains(pocket6, output);
+ Assert.DoesNotContain(pocket7, output);
}
[Fact]

Extend tests with semi private pocket