Esempio n. 1
0
        public void OnItemChosenShouldCloseWindow()
        {
            var typePickerWindow = TypePickerWindow.ShowWindow(typeof(A), new[] { typeof(A) }, null);

            typePickerWindow.OnItemChosen(typeof(A));
            Assert.IsFalse(EditorWindow.HasOpenInstances <TypePickerWindow>());
        }
Esempio n. 2
0
        public void OnItemChosenShouldSelectType()
        {
            bool onSelectCalled = false;

            void OnSelect(Type type)
            {
                if (type == typeof(A))
                {
                    onSelectCalled = true;
                }
            }

            var typePickerWindow = TypePickerWindow.ShowWindow(typeof(A), new[] { typeof(A) }, OnSelect);

            typePickerWindow.OnItemChosen(typeof(A));
            Assert.IsTrue(onSelectCalled);
        }