Skip to content

Commit 376c9f8

Browse files
Update tolerance to be tighter and fix indentation/descriptions
1 parent ee0e32e commit 376c9f8

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

UnitTests/UnitTests.UWP/UI/Controls/Test_ConstrainedBox.AspectRatio.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ await App.DispatcherQueue.EnqueueAsync(async () =>
5151
Assert.IsNotNull(child, "Could not find inner Border");
5252

5353
// Check Size
54-
Assert.AreEqual(200, child.ActualWidth, 1, "Actual width does not meet expected value of 200");
55-
Assert.AreEqual(100, child.ActualHeight, 1, "Actual height does not meet expected value of 100");
54+
Assert.AreEqual(200, child.ActualWidth, 0.01, "Actual width does not meet expected value of 200");
55+
Assert.AreEqual(100, child.ActualHeight, 0.01, "Actual height does not meet expected value of 100");
5656
});
5757
}
5858

@@ -88,8 +88,8 @@ await App.DispatcherQueue.EnqueueAsync(async () =>
8888
Assert.IsNotNull(child, "Could not find inner Border");
8989

9090
// Check Size
91-
Assert.AreEqual(100, child.ActualWidth, 1, "Actual width does not meet expected value of 100");
92-
Assert.AreEqual(200, child.ActualHeight, 1, "Actual height does not meet expected value of 200");
91+
Assert.AreEqual(100, child.ActualWidth, 0.01, "Actual width does not meet expected value of 100");
92+
Assert.AreEqual(200, child.ActualHeight, 0.01, "Actual height does not meet expected value of 200");
9393
});
9494
}
9595
}

UnitTests/UnitTests.UWP/UI/Controls/Test_ConstrainedBox.Multiple.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ await App.DispatcherQueue.EnqueueAsync(async () =>
5555
Assert.IsNotNull(child, "Could not find inner Border");
5656

5757
// Check Size
58-
Assert.AreEqual(192, child.ActualWidth, 1, "Actual width does not meet expected value of 192");
59-
Assert.AreEqual(200, child.ActualHeight, 1, "Actual height does not meet expected value of 200");
58+
Assert.AreEqual(192, child.ActualWidth, 0.01, "Actual width does not meet expected value of 192");
59+
Assert.AreEqual(200, child.ActualHeight, 0.01, "Actual height does not meet expected value of 200");
6060

6161
// Check inner Positioning, we do this from the Grid as the ConstainedBox also modifies its own size
6262
// and is hugging the child.
6363
var position = grid.CoordinatesTo(child);
6464

65-
Assert.AreEqual(4, position.X);
66-
Assert.AreEqual(0, position.Y);
65+
Assert.AreEqual(4, position.X, 0.01, "X position does not meet expected value of 4");
66+
Assert.AreEqual(0, position.Y, 0.01, "Y position does not meet expected value of 0");
6767
});
6868
}
6969

@@ -104,15 +104,15 @@ await App.DispatcherQueue.EnqueueAsync(async () =>
104104
Assert.IsNotNull(child, "Could not find inner Border");
105105

106106
// Check Size
107-
Assert.AreEqual(200, child.ActualWidth, "Actual width does not meet expected value of 200");
108-
Assert.AreEqual(192, child.ActualHeight, "Actual height does not meet expected value of 192");
107+
Assert.AreEqual(200, child.ActualWidth, 0.01, "Actual width does not meet expected value of 200");
108+
Assert.AreEqual(192, child.ActualHeight, 0.01, "Actual height does not meet expected value of 192");
109109

110110
// Check inner Positioning, we do this from the Grid as the ConstainedBox also modifies its own size
111111
// and is hugging the child.
112112
var position = grid.CoordinatesTo(child);
113113

114-
Assert.AreEqual(0, position.X);
115-
Assert.AreEqual(4, position.Y);
114+
Assert.AreEqual(0, position.X, 0.01, "X position does not meet expected value of 0");
115+
Assert.AreEqual(4, position.Y, 0.01, "Y position does not meet expected value of 4");
116116
});
117117
}
118118
}

UnitTests/UnitTests.UWP/UI/Controls/Test_ConstrainedBox.Scale.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ await App.DispatcherQueue.EnqueueAsync(async () =>
5555
Assert.IsNotNull(child, "Could not find inner Border");
5656

5757
// Check Size
58-
Assert.AreEqual(100, child.ActualWidth, 1, "Actual width does not meet expected value of 100");
59-
Assert.AreEqual(200, child.ActualHeight, 1, "Actual height does not meet expected value of 200");
58+
Assert.AreEqual(100, child.ActualWidth, 0.01, "Actual width does not meet expected value of 100");
59+
Assert.AreEqual(200, child.ActualHeight, 0.01, "Actual height does not meet expected value of 200");
6060

6161
// Check inner Positioning, we do this from the Grid as the ConstainedBox also modifies its own size
6262
// and is hugging the child.
6363
var position = grid.CoordinatesTo(child);
6464

65-
Assert.AreEqual(50, position.X);
66-
Assert.AreEqual(0, position.Y);
65+
Assert.AreEqual(50, position.X, 0.01, "X position does not meet expected value of 50");
66+
Assert.AreEqual(0, position.Y, 0.01, "Y position does not meet expected value of 0");
6767
});
6868
}
6969

@@ -104,15 +104,15 @@ await App.DispatcherQueue.EnqueueAsync(async () =>
104104
Assert.IsNotNull(child, "Could not find inner Border");
105105

106106
// Check Size
107-
Assert.AreEqual(200, child.ActualWidth, 1, "Actual width does not meet expected value of 200");
108-
Assert.AreEqual(100, child.ActualHeight, 1, "Actual height does not meet expected value of 100");
107+
Assert.AreEqual(200, child.ActualWidth, 0.01, "Actual width does not meet expected value of 200");
108+
Assert.AreEqual(100, child.ActualHeight, 0.01, "Actual height does not meet expected value of 100");
109109

110110
// Check inner Positioning, we do this from the Grid as the ConstainedBox also modifies its own size
111111
// and is hugging the child.
112112
var position = grid.CoordinatesTo(child);
113113

114-
Assert.AreEqual(0, position.X);
115-
Assert.AreEqual(50, position.Y);
114+
Assert.AreEqual(0, position.X, 0.01, "X position does not meet expected value of 0");
115+
Assert.AreEqual(50, position.Y, 0.01, "Y position does not meet expected value of 50");
116116
});
117117
}
118118
}

0 commit comments

Comments
 (0)