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

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