xamarin-macios/tests/monotouch-test/AppKit/NSColor.cs

41 строка
882 B
C#
Исходник Обычный вид История

#if __MACOS__
2016-05-26 16:06:52 +03:00
using System;
using System.Threading.Tasks;
using NUnit.Framework;
using AppKit;
using Foundation;
using ObjCRuntime;
2016-05-26 16:06:52 +03:00
namespace Xamarin.Mac.Tests
{
[TestFixture]
[Preserve (AllMembers = true)]
2016-05-26 16:06:52 +03:00
public class NSColorTests
{
[Test]
public void NSColor_ComponentTests ()
{
NSColor c = NSColor.Blue;
nfloat [] components;
c.GetComponents (out components);
Assert.IsTrue (0f == components[0], "Red");
Assert.IsTrue (0f == components[1], "Green");
Assert.IsTrue (1f == components[2], "Blue");
}
[Test]
public void SingleComponents ()
{
var c = NSColor.Red;
nfloat[] components;
c.GetComponents (out components);
Assert.AreEqual (c.RedComponent, components [0], "Red");
Assert.AreEqual (c.GreenComponent, components [1], "Green");
Assert.AreEqual (c.BlueComponent, components [2], "Blue");
}
}
}
#endif // __MACOS__