Welcome to mirror list, hosted at ThFree Co, Russian Federation.

RadialGradientBrushPropertyViewModelTests.cs « Xamarin.PropertyEditing.Tests - github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c7a1a9b6649a9a1091ef27b648d9fe6a09fc65c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using Xamarin.PropertyEditing.Drawing;

namespace Xamarin.PropertyEditing.Tests
{
	internal class RadialGradientBrushPropertyViewModelTests : BrushPropertyViewModelTests
	{
		protected override CommonBrush GetRandomTestValue (Random rand)
		{
			var center = new CommonPoint (
				rand.NextDouble(),
				rand.NextDouble()
			);
			var gradientOrigin = new CommonPoint (
				rand.NextDouble (),
				rand.NextDouble ()
			);
			var radiusX = rand.NextDouble ();
			var radiusY = 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 CommonRadialGradientBrush (
				center, gradientOrigin,
				radiusX, radiusY,
				stops,
				colorInterpolationMode,
				mappingMode,
				spreadMethod,
				opacity);
		}
	}
}