diff options
author | Bertrand Le Roy <beleroy@microsoft.com> | 2017-09-14 03:04:53 +0300 |
---|---|---|
committer | Bertrand Le Roy <beleroy@microsoft.com> | 2017-09-18 23:30:52 +0300 |
commit | b5cf55e8fa11357e4c6198a60b5c2b9c24013cd3 (patch) | |
tree | e029b8cb6fae0187fd8ace244d85f9125b82a28c /Xamarin.PropertyEditing.Tests/ImageBrushPropertyViewModelTests.cs | |
parent | bea5a0bd5e7f49f0760ccf35935fca96e3670bde (diff) |
Add tests for the brush view model for each concrete brush type.
Diffstat (limited to 'Xamarin.PropertyEditing.Tests/ImageBrushPropertyViewModelTests.cs')
-rw-r--r-- | Xamarin.PropertyEditing.Tests/ImageBrushPropertyViewModelTests.cs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Xamarin.PropertyEditing.Tests/ImageBrushPropertyViewModelTests.cs b/Xamarin.PropertyEditing.Tests/ImageBrushPropertyViewModelTests.cs new file mode 100644 index 0000000..e2189f2 --- /dev/null +++ b/Xamarin.PropertyEditing.Tests/ImageBrushPropertyViewModelTests.cs @@ -0,0 +1,40 @@ +using System; +using Xamarin.PropertyEditing.Drawing; + +namespace Xamarin.PropertyEditing.Tests +{ + internal class ImageBrushPropertyViewModelTests : BrushPropertyViewModelTests + { + protected override CommonBrush GetRandomTestValue (Random rand) + { + var imageSource = rand.NextFilename (".gif"); + var alignmentX = rand.Next<CommonAlignmentX> (); + var alignmentY = rand.Next<CommonAlignmentY> (); + var stretch = rand.Next<CommonStretch> (); + var tileMode = rand.Next<CommonTileMode> (); + var viewBox = new CommonRectangle ( + rand.NextDouble(), + rand.NextDouble(), + rand.NextDouble(), + rand.NextDouble() + ); + var viewBoxUnit = rand.Next<CommonBrushMappingMode> (); + var viewPort = new CommonRectangle ( + rand.NextDouble (), + rand.NextDouble (), + rand.NextDouble (), + rand.NextDouble () + ); + var viewPortUnit = rand.Next<CommonBrushMappingMode> (); + var opacity = rand.NextDouble (); + + return new CommonImageBrush ( + imageSource, + alignmentX, alignmentY, + stretch, tileMode, + viewBox, viewBoxUnit, + viewPort, viewPortUnit, + opacity); + } + } +} |