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/LinearGradientBrushPropertyViewModelTests.cs | |
parent | bea5a0bd5e7f49f0760ccf35935fca96e3670bde (diff) |
Add tests for the brush view model for each concrete brush type.
Diffstat (limited to 'Xamarin.PropertyEditing.Tests/LinearGradientBrushPropertyViewModelTests.cs')
-rw-r--r-- | Xamarin.PropertyEditing.Tests/LinearGradientBrushPropertyViewModelTests.cs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Xamarin.PropertyEditing.Tests/LinearGradientBrushPropertyViewModelTests.cs b/Xamarin.PropertyEditing.Tests/LinearGradientBrushPropertyViewModelTests.cs new file mode 100644 index 0000000..cdffcf8 --- /dev/null +++ b/Xamarin.PropertyEditing.Tests/LinearGradientBrushPropertyViewModelTests.cs @@ -0,0 +1,37 @@ +using System; +using Xamarin.PropertyEditing.Drawing; + +namespace Xamarin.PropertyEditing.Tests +{ + internal class LinearGradientBrushPropertyViewModelTests : BrushPropertyViewModelTests + { + protected override CommonBrush GetRandomTestValue (Random rand) + { + var startPoint = new CommonPoint ( + rand.NextDouble(), + rand.NextDouble() + ); + var endPoint = new CommonPoint ( + rand.NextDouble (), + rand.NextDouble () + ); + var stops = new[] { + new CommonGradientStop(rand.NextColor(), rand.NextDouble()), + new CommonGradientStop(rand.NextColor(), rand.NextDouble()), + new CommonGradientStop(rand.NextColor(), rand.NextDouble()) + }; + var colorInterpolationMode = rand.Next<CommonColorInterpolationMode> (); + var mappingMode = rand.Next<CommonBrushMappingMode> (); + var spreadMethod = rand.Next<CommonGradientSpreadMethod> (); + var opacity = rand.NextDouble (); + + return new CommonLinearGradientBrush ( + startPoint, endPoint, + stops, + colorInterpolationMode, + mappingMode, + spreadMethod, + opacity); + } + } +} |