diff options
author | Lluis Sanchez Gual <lluis@MacBook-Air-de-Lluis.local> | 2012-09-27 19:39:48 +0400 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@MacBook-Air-de-Lluis.local> | 2012-09-27 19:39:48 +0400 |
commit | 92b85a59a15ecb6d9880976a7af74888b3f2ff53 (patch) | |
tree | c48c0ce6f316951667d2349e6c6f8ea6afd78401 /Test | |
parent | c769c7afd423c660283e4c49d55ada769106f012 (diff) |
index on master: c769c7a Add GtkMac bridge (MonoMac hosted in Gtk) project
Diffstat (limited to 'Test')
-rw-r--r-- | Test/ButtonTests.cs | 38 | ||||
-rw-r--r-- | Test/CanvasTests.cs | 38 | ||||
-rw-r--r-- | Test/CheckBoxTests.cs | 38 | ||||
-rw-r--r-- | Test/ComboBoxEntryTests.cs | 40 | ||||
-rw-r--r-- | Test/ComboBoxTests.cs | 39 | ||||
-rw-r--r-- | Test/FrameTests.cs | 39 | ||||
-rw-r--r-- | Test/HBoxTests.cs | 38 | ||||
-rw-r--r-- | Test/HPanedTests.cs | 38 | ||||
-rw-r--r-- | Test/HSeparatorTests.cs | 38 | ||||
-rw-r--r-- | Test/ImageViewTests.cs | 38 | ||||
-rw-r--r-- | Test/LabelTests.cs | 38 | ||||
-rw-r--r-- | Test/ListBoxTests.cs | 38 | ||||
-rw-r--r-- | Test/ListViewTests.cs | 38 | ||||
-rw-r--r-- | Test/NotebookTests.cs | 38 | ||||
-rw-r--r-- | Test/ProgressBarTests.cs | 38 | ||||
-rw-r--r-- | Test/ScrollViewTests.cs | 38 | ||||
-rw-r--r-- | Test/Setup.cs | 46 | ||||
-rw-r--r-- | Test/SpinButtonTests.cs | 38 | ||||
-rw-r--r-- | Test/TableTests.cs | 38 | ||||
-rw-r--r-- | Test/Test.csproj | 74 | ||||
-rw-r--r-- | Test/TextEntryTests.cs | 38 | ||||
-rw-r--r-- | Test/VBoxTests.cs | 38 | ||||
-rw-r--r-- | Test/VPanedTests.cs | 38 | ||||
-rw-r--r-- | Test/VSeparatorTests.cs | 38 | ||||
-rw-r--r-- | Test/WidgetTests.cs | 239 |
25 files changed, 1199 insertions, 0 deletions
diff --git a/Test/ButtonTests.cs b/Test/ButtonTests.cs new file mode 100644 index 00000000..fa8bedf9 --- /dev/null +++ b/Test/ButtonTests.cs @@ -0,0 +1,38 @@ +// +// ButtonTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Xwt +{ + public class ButtonTests: WidgetTests + { + public override Widget CreateWidget () + { + return new Button (); + } + } +} + diff --git a/Test/CanvasTests.cs b/Test/CanvasTests.cs new file mode 100644 index 00000000..8044e165 --- /dev/null +++ b/Test/CanvasTests.cs @@ -0,0 +1,38 @@ +// +// CanvasTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Xwt +{ + public class CanvasTests: WidgetTests + { + public override Widget CreateWidget () + { + return new Canvas (); + } + } +} + diff --git a/Test/CheckBoxTests.cs b/Test/CheckBoxTests.cs new file mode 100644 index 00000000..b79361a5 --- /dev/null +++ b/Test/CheckBoxTests.cs @@ -0,0 +1,38 @@ +// +// CheckBoxTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Xwt +{ + public class CheckBoxTests: WidgetTests + { + public override Widget CreateWidget () + { + return new CheckBox (); + } + } +} + diff --git a/Test/ComboBoxEntryTests.cs b/Test/ComboBoxEntryTests.cs new file mode 100644 index 00000000..870832e2 --- /dev/null +++ b/Test/ComboBoxEntryTests.cs @@ -0,0 +1,40 @@ +// +// ComboBoxEntryTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using NUnit.Framework; + +namespace Xwt +{ + [Ignore] + public class ComboBoxEntryTests: WidgetTests + { + public override Widget CreateWidget () + { + return new ComboBoxEntry (); + } + } +} + diff --git a/Test/ComboBoxTests.cs b/Test/ComboBoxTests.cs new file mode 100644 index 00000000..cf39f4b6 --- /dev/null +++ b/Test/ComboBoxTests.cs @@ -0,0 +1,39 @@ +// +// ComboBoxTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using NUnit.Framework; + +namespace Xwt +{ + public class ComboBoxTests: WidgetTests + { + public override Widget CreateWidget () + { + return new ComboBox (); + } + } +} + diff --git a/Test/FrameTests.cs b/Test/FrameTests.cs new file mode 100644 index 00000000..b3c6248a --- /dev/null +++ b/Test/FrameTests.cs @@ -0,0 +1,39 @@ +// +// FrameTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using NUnit.Framework; + +namespace Xwt +{ + public class FrameTests: WidgetTests + { + public override Widget CreateWidget () + { + return new Frame (); + } + } +} + diff --git a/Test/HBoxTests.cs b/Test/HBoxTests.cs new file mode 100644 index 00000000..cd5f3bfe --- /dev/null +++ b/Test/HBoxTests.cs @@ -0,0 +1,38 @@ +// +// HBoxTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Xwt +{ + public class HBoxTests: WidgetTests + { + public override Widget CreateWidget () + { + return new HBox (); + } + } +} + diff --git a/Test/HPanedTests.cs b/Test/HPanedTests.cs new file mode 100644 index 00000000..ceeba9df --- /dev/null +++ b/Test/HPanedTests.cs @@ -0,0 +1,38 @@ +// +// HPanedTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Xwt +{ + public class HPanedTests: WidgetTests + { + public override Widget CreateWidget () + { + return new HPaned (); + } + } +} + diff --git a/Test/HSeparatorTests.cs b/Test/HSeparatorTests.cs new file mode 100644 index 00000000..34717a1d --- /dev/null +++ b/Test/HSeparatorTests.cs @@ -0,0 +1,38 @@ +// +// HSeparator.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Xwt +{ + public class HSeparatorTests: WidgetTests + { + public override Widget CreateWidget () + { + return new HSeparator (); + } + } +} + diff --git a/Test/ImageViewTests.cs b/Test/ImageViewTests.cs new file mode 100644 index 00000000..6f1a6b8f --- /dev/null +++ b/Test/ImageViewTests.cs @@ -0,0 +1,38 @@ +// +// ImageViewTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Xwt +{ + public class ImageViewTests: WidgetTests + { + public override Widget CreateWidget () + { + return new ImageView (); + } + } +} + diff --git a/Test/LabelTests.cs b/Test/LabelTests.cs new file mode 100644 index 00000000..c368eb67 --- /dev/null +++ b/Test/LabelTests.cs @@ -0,0 +1,38 @@ +// +// LabelTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Xwt +{ + public class LabelTests: WidgetTests + { + public override Widget CreateWidget () + { + return new Label (); + } + } +} + diff --git a/Test/ListBoxTests.cs b/Test/ListBoxTests.cs new file mode 100644 index 00000000..0146dac4 --- /dev/null +++ b/Test/ListBoxTests.cs @@ -0,0 +1,38 @@ +// +// ListBoxTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Xwt +{ + public class ListBoxTests: WidgetTests + { + public override Widget CreateWidget () + { + return new ListBox (); + } + } +} + diff --git a/Test/ListViewTests.cs b/Test/ListViewTests.cs new file mode 100644 index 00000000..4fbce9c6 --- /dev/null +++ b/Test/ListViewTests.cs @@ -0,0 +1,38 @@ +// +// ListViewTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Xwt +{ + public class ListViewTests: WidgetTests + { + public override Widget CreateWidget () + { + return new ListView (); + } + } +} + diff --git a/Test/NotebookTests.cs b/Test/NotebookTests.cs new file mode 100644 index 00000000..2da4b255 --- /dev/null +++ b/Test/NotebookTests.cs @@ -0,0 +1,38 @@ +// +// NotebookTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Xwt +{ + public class NotebookTests: WidgetTests + { + public override Widget CreateWidget () + { + return new Notebook (); + } + } +} + diff --git a/Test/ProgressBarTests.cs b/Test/ProgressBarTests.cs new file mode 100644 index 00000000..d7b33c59 --- /dev/null +++ b/Test/ProgressBarTests.cs @@ -0,0 +1,38 @@ +// +// ProgressBarTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Xwt +{ + public class ProgressBarTests: WidgetTests + { + public override Widget CreateWidget () + { + return new ProgressBar (); + } + } +} + diff --git a/Test/ScrollViewTests.cs b/Test/ScrollViewTests.cs new file mode 100644 index 00000000..db418be9 --- /dev/null +++ b/Test/ScrollViewTests.cs @@ -0,0 +1,38 @@ +// +// ScrollViewTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Xwt +{ + public class ScrollViewTests: WidgetTests + { + public override Widget CreateWidget () + { + return new ScrollView (); + } + } +} + diff --git a/Test/Setup.cs b/Test/Setup.cs new file mode 100644 index 00000000..7271c92f --- /dev/null +++ b/Test/Setup.cs @@ -0,0 +1,46 @@ +// +// Setup.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using NUnit.Framework; + +namespace Xwt +{ + [SetUpFixture] + public class Setup + { + [SetUp] + public void SetUp () + { + Xwt.Application.Initialize ("Xwt.GtkBackend.GtkEngine, Xwt.Gtk, Version=1.0.0.0"); + } + + [TearDown] + public void Cleanup () + { + } + } +} + diff --git a/Test/SpinButtonTests.cs b/Test/SpinButtonTests.cs new file mode 100644 index 00000000..498563ba --- /dev/null +++ b/Test/SpinButtonTests.cs @@ -0,0 +1,38 @@ +// +// SpinButtonTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Xwt +{ + public class SpinButtonTests: WidgetTests + { + public override Widget CreateWidget () + { + return new SpinButton (); + } + } +} + diff --git a/Test/TableTests.cs b/Test/TableTests.cs new file mode 100644 index 00000000..d489d76a --- /dev/null +++ b/Test/TableTests.cs @@ -0,0 +1,38 @@ +// +// TableTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Xwt +{ + public class TableTests: WidgetTests + { + public override Widget CreateWidget () + { + return new Table (); + } + } +} + diff --git a/Test/Test.csproj b/Test/Test.csproj new file mode 100644 index 00000000..dd47c990 --- /dev/null +++ b/Test/Test.csproj @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>10.0.0</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{3C7623A9-9E16-41F6-BBB2-0B550F28E749}</ProjectGuid> + <OutputType>Library</OutputType> + <RootNamespace>Test</RootNamespace> + <AssemblyName>Test</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>True</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>False</Optimize> + <OutputPath>bin\Debug</OutputPath> + <DefineConstants>DEBUG;</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <ConsolePause>False</ConsolePause> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>none</DebugType> + <Optimize>True</Optimize> + <OutputPath>bin\Release</OutputPath> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <ConsolePause>False</ConsolePause> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="nunit.framework"> + <Private>False</Private> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="ButtonTests.cs" /> + <Compile Include="WidgetTests.cs" /> + <Compile Include="Setup.cs" /> + <Compile Include="TextEntryTests.cs" /> + <Compile Include="HBoxTests.cs" /> + <Compile Include="VBoxTests.cs" /> + <Compile Include="CanvasTests.cs" /> + <Compile Include="CheckBoxTests.cs" /> + <Compile Include="ComboBoxTests.cs" /> + <Compile Include="ComboBoxEntryTests.cs" /> + <Compile Include="FrameTests.cs" /> + <Compile Include="HPanedTests.cs" /> + <Compile Include="VPanedTests.cs" /> + <Compile Include="HSeparatorTests.cs" /> + <Compile Include="ImageViewTests.cs" /> + <Compile Include="LabelTests.cs" /> + <Compile Include="ListBoxTests.cs" /> + <Compile Include="ListViewTests.cs" /> + <Compile Include="NotebookTests.cs" /> + <Compile Include="ProgressBarTests.cs" /> + <Compile Include="ScrollViewTests.cs" /> + <Compile Include="SpinButtonTests.cs" /> + <Compile Include="TableTests.cs" /> + <Compile Include="VSeparatorTests.cs" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <ItemGroup> + <ProjectReference Include="..\Xwt\Xwt.csproj"> + <Project>{92494904-35FA-4DC9-BDE9-3A3E87AC49D3}</Project> + <Name>Xwt</Name> + </ProjectReference> + <ProjectReference Include="..\Xwt.Gtk\Xwt.Gtk.csproj"> + <Project>{C3887A93-B2BD-4097-8E2F-3A063EFF32FD}</Project> + <Name>Xwt.Gtk</Name> + </ProjectReference> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/Test/TextEntryTests.cs b/Test/TextEntryTests.cs new file mode 100644 index 00000000..310f9b0a --- /dev/null +++ b/Test/TextEntryTests.cs @@ -0,0 +1,38 @@ +// +// TextEntryTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Xwt +{ + public class TextEntryTests: WidgetTests + { + public override Widget CreateWidget () + { + return new TextEntry (); + } + } +} + diff --git a/Test/VBoxTests.cs b/Test/VBoxTests.cs new file mode 100644 index 00000000..5533aea8 --- /dev/null +++ b/Test/VBoxTests.cs @@ -0,0 +1,38 @@ +// +// VBoxTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Xwt +{ + public class VBoxTests: WidgetTests + { + public override Widget CreateWidget () + { + return new VBox (); + } + } +} + diff --git a/Test/VPanedTests.cs b/Test/VPanedTests.cs new file mode 100644 index 00000000..bb5e5664 --- /dev/null +++ b/Test/VPanedTests.cs @@ -0,0 +1,38 @@ +// +// VPanedTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Xwt +{ + public class VPanedTests: WidgetTests + { + public override Widget CreateWidget () + { + return new VPaned (); + } + } +} + diff --git a/Test/VSeparatorTests.cs b/Test/VSeparatorTests.cs new file mode 100644 index 00000000..44563c87 --- /dev/null +++ b/Test/VSeparatorTests.cs @@ -0,0 +1,38 @@ +// +// VSeparatorTests.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace Xwt +{ + public class VSeparatorTests: WidgetTests + { + public override Widget CreateWidget () + { + return new VSeparator (); + } + } +} + diff --git a/Test/WidgetTests.cs b/Test/WidgetTests.cs new file mode 100644 index 00000000..f2ff0919 --- /dev/null +++ b/Test/WidgetTests.cs @@ -0,0 +1,239 @@ +// +// Widget.cs +// +// Author: +// Lluis Sanchez <lluis@xamarin.com> +// +// Copyright (c) 2012 Xamarin Inc +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using NUnit.Framework; + +namespace Xwt +{ + [TestFixture] + public abstract class WidgetTests + { + public abstract Widget CreateWidget (); + + [TestFixtureSetUp] + public void Init () + { + } + + [TestFixtureTearDown] + public void Cleanup () + { + } + + public void Run (Action a) + { + Exception ex = null; + Application.Invoke (delegate { + try { + a (); + } catch (Exception e) { + ex = e; + } + Application.Exit (); + }); + Application.Run (); + if (ex != null) + throw new Exception ("Exception in gui event loop", ex); + } + + [Test] + public void Visibility () + { + var w = CreateWidget (); + Assert.IsTrue (w.Visible, "Not visible by default"); + w.Hide (); + Assert.IsFalse (w.Visible); + w.Show (); + Assert.IsTrue (w.Visible); + w.Visible = false; + Assert.IsFalse (w.Visible); + w.Visible = true; + Assert.IsTrue (w.Visible); + } + + [Test] + public void Sensitivity () + { + var w = CreateWidget (); + Assert.IsTrue (w.Sensitive, "Not sensitive by default"); + w.Sensitive = false; + Assert.IsFalse (w.Sensitive); + w.Sensitive = true; + Assert.IsTrue (w.Sensitive); + } + + [Test] + public void ParentWindow () + { + var w = CreateWidget (); + var win = new Window (); + win.Content = w; + Assert.AreSame (win, w.ParentWindow); + win.Dispose (); + } + + [Test] + public void Margin () + { + var w = CreateWidget (); + Assert.AreEqual (0, w.Margin.Left); + Assert.AreEqual (0, w.Margin.Top); + Assert.AreEqual (0, w.Margin.Right); + Assert.AreEqual (0, w.Margin.Bottom); + w.Margin.SetAll (4); + Assert.AreEqual (4, w.Margin.Left); + Assert.AreEqual (4, w.Margin.Top); + Assert.AreEqual (4, w.Margin.Right); + Assert.AreEqual (4, w.Margin.Bottom); + w.Margin.Set (10, 20, 30, 40); + Assert.AreEqual (10, w.Margin.Left); + Assert.AreEqual (20, w.Margin.Top); + Assert.AreEqual (30, w.Margin.Right); + Assert.AreEqual (40, w.Margin.Bottom); + w.Margin.Left = 1; + Assert.AreEqual (1, w.Margin.Left); + Assert.AreEqual (20, w.Margin.Top); + Assert.AreEqual (30, w.Margin.Right); + Assert.AreEqual (40, w.Margin.Bottom); + w.Margin.Top = 2; + Assert.AreEqual (1, w.Margin.Left); + Assert.AreEqual (2, w.Margin.Top); + Assert.AreEqual (30, w.Margin.Right); + Assert.AreEqual (40, w.Margin.Bottom); + w.Margin.Right = 3; + Assert.AreEqual (1, w.Margin.Left); + Assert.AreEqual (2, w.Margin.Top); + Assert.AreEqual (3, w.Margin.Right); + Assert.AreEqual (40, w.Margin.Bottom); + w.Margin.Bottom = 4; + Assert.AreEqual (1, w.Margin.Left); + Assert.AreEqual (2, w.Margin.Top); + Assert.AreEqual (3, w.Margin.Right); + Assert.AreEqual (4, w.Margin.Bottom); + } + + [Test] + public void Focus () + { + var win = new Window (); + var w = CreateWidget (); + + Run (delegate { + HBox box = new HBox (); + TextEntry e = new TextEntry (); + box.PackStart (e); + box.PackStart (w); + win.Content = box; + win.Show (); + win.Present (); + +// for (int n=0; n < 500; n++) { + Application.DispatchPendingEvents (); +// System.Threading.Thread.Sleep (10); +// } + + e.SetFocus (); + + Application.DispatchPendingEvents (); + + Assert.IsFalse (w.HasFocus); + // Assert.IsTrue (w.CanGetFocus); + + int gotFocus = 0; + w.GotFocus += delegate { + gotFocus++; + }; + + w.SetFocus (); + Assert.IsTrue (w.HasFocus); + Assert.AreEqual (1, gotFocus); + + int lostFocus = 0; + w.LostFocus += delegate { + lostFocus++; + }; + + e.SetFocus (); + + Assert.IsFalse (w.HasFocus); + // Assert.AreEqual (1, lostFocus); + + win.Dispose (); + }); + } + + [Test] + [Ignore] + public void MinSize () + { + var win = new Window (); + var w = CreateWidget (); + + win.Content = w; + win.Show (); + + Application.DispatchPendingEvents (); + + var defw = w.Size.Width; + var defh = w.Size.Height; + + w.MinWidth = 300; + Assert.AreEqual (300, w.MinWidth); + Assert.AreEqual (300, w.Size.Width); + + w.MinHeight = 400; + Assert.AreEqual (400, w.MinHeight); + Assert.AreEqual (400, w.Size.Height); + + w.MinWidth = -1; + Assert.AreEqual (-1, w.MinWidth); + Assert.AreEqual (defw, w.Size.Width); + + w.MinHeight = -1; + Assert.AreEqual (-1, w.MinHeight); + Assert.AreEqual (defh, w.Size.Height); + + win.Dispose (); + } + + [Test] + [Ignore] + public void Coordinates () + { + var win = new Window (); + var w = CreateWidget (); + win.Content = w; + win.Show (); + + Application.DispatchPendingEvents (); + + Assert.AreEqual (w.ScreenBounds, win.ScreenBounds); + + win.Dispose (); + } + } +} + |