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

LinearGradientBrushPropertyViewModelTests.cs « Xamarin.PropertyEditing.Tests - github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cdffcf8616e986444b788611da3963d005bd9e46 (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
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);
		}
	}
}