Esempio n. 1
0
        public void NSAppearanceCustomizationNull()
        {
            Asserts.EnsureYosemite();

            using (NSButton b = new NSButton())
                b.SetAppearance(null);
        }
Esempio n. 2
0
        public void Setup()
        {
            Asserts.EnsureYosemite();

            source      = new NSViewController();
            destination = new NSViewController();
            segue       = new NSStoryboardSegue("Test", source, destination);
        }
Esempio n. 3
0
 public void SetUp()
 {
     Asserts.EnsureYosemite();
     if (Asserts.IsAtLeastElCapitan)
     {
         Asserts.Ensure64Bit();
     }
 }
Esempio n. 4
0
        public void NSAppearanceShouldLoadAppearanceNamed()
        {
            Asserts.EnsureYosemite();

            var appearance = NSAppearance.GetAppearance(NSAppearance.NameVibrantDark);

            Assert.IsNotNull(appearance, "NSAppearanceShouldLoadAppearanceNamed - Failed to initialize appearance VibrantDark");
            Assert.AreEqual(appearance.Name, NSAppearance.NameVibrantDark.ToString(), "NSAppearanceShouldLoadAppearanceNamed - Appearance initialized with incorrect name.");
        }
Esempio n. 5
0
        public void SCNGeometrySource_BoneStringTests()          // These were radar://17782603
        {
            Asserts.EnsureYosemite();

#pragma warning disable 0219
            SCNGeometrySource d = SCNGeometrySource.FromData(new NSData(), SCNGeometrySourceSemantic.BoneWeights, 1, false, 1, 1, 1, 1);
            d = SCNGeometrySource.FromData(new NSData(), SCNGeometrySourceSemantic.BoneIndices, 1, false, 1, 1, 1, 1);
#pragma warning restore 0219
        }
Esempio n. 6
0
        public void SCNNode_BackfaceCulling()
        {
            Asserts.EnsureYosemite();

            if (IntPtr.Size == 8)
            {
                Assert.IsNotNull(SCNPhysicsTestKeys.BackfaceCullingKey);
            }
        }
Esempio n. 7
0
        public void NSTextViewShouldChangeUsesRolloverButtonForSelection()
        {
            Asserts.EnsureYosemite();

            var usesRollover = view.UsesRolloverButtonForSelection;

            view.UsesRolloverButtonForSelection = !usesRollover;

            Assert.IsFalse(view.UsesRolloverButtonForSelection == usesRollover, "NSTextViewShouldChangeUsesRolloverButtonForSelection - Failed to set the UsesRolloverButtonForSelection property");
        }
Esempio n. 8
0
        public void NSToolbarShouldChangeAllowsExtensionItems()
        {
            Asserts.EnsureYosemite();

            var allows = toolbar.AllowsExtensionItems;

            toolbar.AllowsExtensionItems = !allows;

            Assert.IsFalse(toolbar.AllowsExtensionItems == allows, "NSToolbarShouldChangeAllowsExtensionItems - Failed to set the AllowsExtensionItems property");
        }
Esempio n. 9
0
        public void NSTabViewItemShouldChangeViewController()
        {
            Asserts.EnsureYosemite();

            var vc = item.ViewController;

            item.ViewController = new NSViewController();

            Assert.IsFalse(item.ViewController == vc, "NSTabViewItemShouldChangeViewController - Failed to set the ViewController property");
        }
Esempio n. 10
0
        public void NSTextFieldShouldChangePlaceholderAttributedString()
        {
            Asserts.EnsureYosemite();

            var placeholder = textField.PlaceholderAttributedString;

            textField.PlaceholderAttributedString = new NSAttributedString("Test");

            Assert.IsFalse(textField.PlaceholderAttributedString == placeholder, "NSTextFieldShouldChangePlaceholderAttributedString - Failed to set the PlaceholderAttributedString property");
        }
Esempio n. 11
0
        public void NSTabViewItemShouldChangeImage()
        {
            Asserts.EnsureYosemite();

            var image = item.Image;

            item.Image = new NSImage();

            Assert.IsFalse(item.Image == image, "NSTabViewItemShouldChangeImage - Failed to set the Image property");
        }
Esempio n. 12
0
        public void NSViewControllerShouldAddChildViewController()
        {
            Asserts.EnsureYosemite();

            var child = new NSViewController();

            controller.AddChildViewController(child);

            Assert.IsTrue(controller.ChildViewControllers.Length == 1, "NSViewControllerShouldAddChildViewControllers - Failed to add child view controller");
        }
Esempio n. 13
0
        public void NSTableRowViewShouldChangeNextRowSelected()
        {
            Asserts.EnsureYosemite();

            var selected = view.NextRowSelected;

            view.NextRowSelected = !selected;

            Assert.IsFalse(view.NextRowSelected == selected, "NSTableRowViewShouldChangeNextRowSelected - Failed to set the NextRowSelected property");
        }
Esempio n. 14
0
        public void NSAppearanceShouldChangeCurrentAppearance()
        {
            Asserts.EnsureYosemite();

            var appearance = NSAppearance.CurrentAppearance;

            NSAppearance.CurrentAppearance = NSAppearance.GetAppearance(NSAppearance.NameVibrantDark);

            Assert.AreNotEqual(appearance, NSAppearance.CurrentAppearance, "NSAppearanceShouldChangeCurrentAppearance - Failed to change appearance.");
        }
Esempio n. 15
0
        public void NSImageResizingModeShouldChange()
        {
            Asserts.EnsureYosemite();

            var image = new NSImage();

            image.ResizingMode = NSImageResizingMode.Stretch;
            Assert.AreEqual(image.ResizingMode, NSImageResizingMode.Stretch, "NSImageResizingMode - Was not equal to Stretch");
            Assert.AreNotEqual(image.ResizingMode, NSImageResizingMode.Tile, "NSImageResizingMode - Was incorrectly equal to Tile");
        }
Esempio n. 16
0
        public void NSTableColumnShouldChangeTitle()
        {
            Asserts.EnsureYosemite();

            var title = column.Title;

            column.Title = "Test";

            Assert.IsFalse(column.Title == title, "NSTableColumnShouldChangeTitle - Failed to set the Title property");
        }
Esempio n. 17
0
        public void NSViewShouldChangeGestureRecognizers()
        {
            Asserts.EnsureYosemite();

            var recognizers = view.GestureRecognizers;

            view.GestureRecognizers = new NSGestureRecognizer [] { new NSClickGestureRecognizer(), new NSPanGestureRecognizer() };

            Assert.IsFalse(view.GestureRecognizers == recognizers);
        }
Esempio n. 18
0
        public void NSPathControlShouldSetEditable()
        {
            Asserts.EnsureYosemite();

            var control  = new NSPathControl();
            var editable = control.Editable;

            control.Editable = !editable;

            Assert.IsTrue(control.Editable != editable, "NSPathControlShouldSetEditable - Failed to change the Editable property");
        }
Esempio n. 19
0
        public void NSPathControlShouldSetPlaceholderAttributedString()
        {
            Asserts.EnsureYosemite();

            var control = new NSPathControl();
            var placeholderAttributedString = control.PlaceholderAttributedString;

            control.PlaceholderAttributedString = new NSAttributedString("Test Placeholder");

            Assert.IsTrue(control.PlaceholderAttributedString != placeholderAttributedString, "NSPathControlShouldSetPlaceholderAttributedString - Failed to change PlaceholderAttributedString property");
        }
Esempio n. 20
0
        public void NSPathControlShouldSetPathItems()
        {
            Asserts.EnsureYosemite();

            var control   = new NSPathControl();
            var pathItems = control.PathItems;

            control.PathItems = new [] { new NSPathControlItem() };

            Assert.IsTrue(control.PathItems != pathItems, "NSPathControlShouldSetPathItems - Failed to set PathItems property");
        }
Esempio n. 21
0
        public void NSPathControlShouldSetAllowedTypes()
        {
            Asserts.EnsureYosemite();

            var control      = new NSPathControl();
            var allowedTypes = control.AllowedTypes;

            control.AllowedTypes = new [] { (NSString)"exe", (NSString)"jpg" };

            Assert.IsTrue(control.AllowedTypes != allowedTypes, "NSPathControlShouldSetAllowedTypes - Failed to change AllowedTypes property");
        }
Esempio n. 22
0
        public void AVAudioIONodeTests_AudioUnitTest()
        {
            Asserts.EnsureYosemite();

            AVAudioEngine eng  = new AVAudioEngine();
            AVAudioIONode node = eng.OutputNode;
            AUUnit        unit = node.AudioUnit;

            unit.GetElementCount(AudioUnitScopeType.Global);
            // Make sure this doens't crash.
        }
Esempio n. 23
0
        public void NSControlShouldChangeHighlighted()
        {
            Asserts.EnsureYosemite();

            var control     = new NSButton();
            var highlighted = control.Highlighted;

            control.Highlighted = !highlighted;

            Assert.IsFalse(highlighted == control.Highlighted);
        }
Esempio n. 24
0
        public void NSControlShouldChangeControlSize()
        {
            Asserts.EnsureYosemite();
            var control = new NSButton();
            var size    = control.ControlSize;

            control.ControlSize = NSControlSize.Mini;

            Assert.IsFalse(size == control.ControlSize);
            Assert.IsTrue(control.ControlSize == NSControlSize.Mini);
        }
Esempio n. 25
0
        public void NSAppearanceCustomizationNull()
        {
            Asserts.EnsureYosemite();

            using (NSButton b = new NSButton()) {
#if NET
                b.Appearance = null;
#else
                b.SetAppearance(null);
#endif
            }
        }
Esempio n. 26
0
        public void NSControlShouldChangeLineBreakMode()
        {
            Asserts.EnsureYosemite();

            var control   = new NSButton();
            var lineBreak = control.LineBreakMode;

            control.LineBreakMode = NSLineBreakMode.Clipping;

            Assert.IsTrue(control.LineBreakMode == NSLineBreakMode.Clipping);
            Assert.IsFalse(lineBreak == control.LineBreakMode);
        }
Esempio n. 27
0
        public void NSViewShouldRemoveGestureRecognizer()
        {
            Asserts.EnsureYosemite();

            var recognizer = new NSClickGestureRecognizer();

            view.AddGestureRecognizer(recognizer);

            Assert.IsTrue(view.GestureRecognizers.Length != 0, "NSViewShouldRemoveGestureRecognizer - Failed to add gesture recognizer");

            view.RemoveGestureRecognizer(recognizer);

            Assert.IsTrue(view.GestureRecognizers.Length == 0, "NSViewShouldRemoveGestureRecognizer - Failed to remove gesture recognizer");
        }
Esempio n. 28
0
        public void NSViewShouldAddGestureRecognizer()
        {
            Asserts.EnsureYosemite();

            var length = 0;

            if (view.GestureRecognizers != null)
            {
                length = view.GestureRecognizers.Length;
            }
            view.AddGestureRecognizer(new NSGestureRecognizer());

            Assert.IsTrue(view.GestureRecognizers.Length == length + 1, "NSViewShouldAddGestureRecognizer - Failed to add recognizer, count didn't change.");
        }
Esempio n. 29
0
        public void NSImageCapInsets()
        {
            Asserts.EnsureYosemite();

            var image = new NSImage();

            image.CapInsets = new NSEdgeInsets(5f, 6f, 7f, 8f);

            Assert.IsNotNull(image.CapInsets);
            Assert.IsTrue(image.CapInsets.Top == 5f, "NSImageCapInsets - Top value was not 5");
            Assert.IsTrue(image.CapInsets.Left == 6f, "NSImageCapInsets - Left value was not 6");
            Assert.IsTrue(image.CapInsets.Bottom == 7f, "NSImageCapInsets - Bottom value was not 7");
            Assert.IsTrue(image.CapInsets.Right == 8f, "NSImageCapInsets - Right value was not 8");
        }
Esempio n. 30
0
        public void NSViewControllerShouldInsertChildViewController()
        {
            Asserts.EnsureYosemite();

            controller.AddChildViewController(new NSViewController());
            controller.AddChildViewController(new NSViewController());

            Assert.IsTrue(controller.ChildViewControllers.Length == 2, "NSViewControllerShouldInsertChildViewController - Failed to add child view controller");

            var child = new NSViewController();

            controller.InsertChildViewController(child, 1);

            Assert.IsTrue(controller.ChildViewControllers.Length == 3, "NSViewControllerShouldInsertChildViewController - Failed to insert child view controller");
            Assert.IsTrue(controller.ChildViewControllers [1] == child, "NSViewControllerShouldInsertChildViewController - Inserted child view controller at the wrong index.");
        }