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

github.com/mono/xwt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLluis Sanchez <lluis@xamarin.com>2013-06-06 22:23:09 +0400
committerLluis Sanchez <lluis@xamarin.com>2013-06-06 22:23:09 +0400
commit28f5bffa8453b1edd001afa6d58f3e03549f6c3a (patch)
treee370bdcf22d0704192e880ad8b1f413a60682e22 /Testing
parenta04e50ddd6f594f408dd8d2c5773cd97bf53983c (diff)
Add a bunch of unit tests
Diffstat (limited to 'Testing')
-rw-r--r--Testing/GtkTestRunner.csproj12
-rw-r--r--Testing/MacTestRunner.csproj2
-rw-r--r--Testing/Tests/BoxTests.cs8
-rw-r--r--Testing/Tests/ContainerTests.cs58
-rw-r--r--Testing/Tests/DatePickerTests.cs38
-rw-r--r--Testing/Tests/ExpanderTests.cs38
-rw-r--r--Testing/Tests/FrameTests.cs7
-rw-r--r--Testing/Tests/HPanedTests.cs4
-rw-r--r--Testing/Tests/NotebookTests.cs7
-rw-r--r--Testing/Tests/PanedTests.cs45
-rw-r--r--Testing/Tests/ScrollViewTests.cs7
-rw-r--r--Testing/Tests/ScrollbarTests.cs56
-rw-r--r--Testing/Tests/SegmentedButtonTests.cs38
-rw-r--r--Testing/Tests/SliderTests.cs38
-rw-r--r--Testing/Tests/SpinnerTests.cs38
-rw-r--r--Testing/Tests/TableTests.cs8
-rw-r--r--Testing/Tests/ToggleButtonTests.cs38
-rw-r--r--Testing/Tests/TreeViewTests.cs38
-rw-r--r--Testing/Tests/VPanedTests.cs4
-rw-r--r--Testing/Tests/VScrollbar.cs37
-rw-r--r--Testing/Tests/WindowTests.cs9
21 files changed, 518 insertions, 12 deletions
diff --git a/Testing/GtkTestRunner.csproj b/Testing/GtkTestRunner.csproj
index 27df4988..82d7416a 100644
--- a/Testing/GtkTestRunner.csproj
+++ b/Testing/GtkTestRunner.csproj
@@ -9,7 +9,7 @@
<OutputType>Exe</OutputType>
<RootNamespace>GtkTestRunner</RootNamespace>
<AssemblyName>GtkTestRunner</AssemblyName>
- <TestRunnerExe>bin\GtkTestRunner.exe</TestRunnerExe>
+ <TestRunnerCommand>bin\GtkTestRunner.exe</TestRunnerCommand>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
@@ -60,6 +60,16 @@
<Compile Include="GtkTestRunner\Main.cs" />
<Compile Include="GtkTestRunner\AssemblyInfo.cs" />
<Compile Include="Tests\**\*.cs" />
+ <Compile Include="Tests\ContainerTests.cs" />
+ <Compile Include="Tests\PanedTests.cs" />
+ <Compile Include="Tests\DatePickerTests.cs" />
+ <Compile Include="Tests\ExpanderTests.cs" />
+ <Compile Include="Tests\ScrollbarTests.cs" />
+ <Compile Include="Tests\SliderTests.cs" />
+ <Compile Include="Tests\SegmentedButtonTests.cs" />
+ <Compile Include="Tests\SpinnerTests.cs" />
+ <Compile Include="Tests\ToggleButtonTests.cs" />
+ <Compile Include="Tests\TreeViewTests.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
diff --git a/Testing/MacTestRunner.csproj b/Testing/MacTestRunner.csproj
index e4b27359..4efe923f 100644
--- a/Testing/MacTestRunner.csproj
+++ b/Testing/MacTestRunner.csproj
@@ -13,7 +13,7 @@
<AssemblyName>MacTestRunner</AssemblyName>
<SuppressXamMacMigration>True</SuppressXamMacMigration>
<SuppressXamMacUpsell>True</SuppressXamMacUpsell>
- <TestRunnerExe>bin\MacTestRunner.app</TestRunnerExe>
+ <TestRunnerCommand>bin\MacTestRunner.app</TestRunnerCommand>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
diff --git a/Testing/Tests/BoxTests.cs b/Testing/Tests/BoxTests.cs
index 1390a8a7..f00ef3e5 100644
--- a/Testing/Tests/BoxTests.cs
+++ b/Testing/Tests/BoxTests.cs
@@ -27,7 +27,7 @@ using System;
namespace Xwt
{
- public abstract class BoxTests: WidgetTests
+ public abstract class BoxTests: ContainerTests
{
public override Widget CreateWidget ()
{
@@ -35,6 +35,12 @@ namespace Xwt
box.PackStart (new Label ("Hello Worlds"));
return box;
}
+
+ protected override void AddChild (Widget parent, Widget child)
+ {
+ ((Box)parent).Clear ();
+ ((Box)parent).PackStart (child, true);
+ }
public abstract Box CreateBox ();
}
diff --git a/Testing/Tests/ContainerTests.cs b/Testing/Tests/ContainerTests.cs
new file mode 100644
index 00000000..5f28f5a3
--- /dev/null
+++ b/Testing/Tests/ContainerTests.cs
@@ -0,0 +1,58 @@
+//
+// ContainerTests.cs
+//
+// Author:
+// Lluis Sanchez <lluis@xamarin.com>
+//
+// Copyright (c) 2013 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 abstract class ContainerTests: WidgetTests
+ {
+ protected abstract void AddChild (Widget parent, Widget child);
+
+ [Test]
+ public void AddChildMargin ()
+ {
+ using (var win = new Window ()) {
+ var c = CreateWidget ();
+ win.Content = c;
+ win.Size = new Size (100, 100);
+ var box = new SquareBox (10);
+ AddChild (c, box);
+ ShowWindow (win);
+ var r1 = box.ScreenBounds;
+ box.Margin = new WidgetSpacing (5, 10, 15, 20);
+ WaitForEvents ();
+ var r2 = box.ScreenBounds;
+
+ Assert.AreEqual (r1.Left + 5, r2.Left);
+ Assert.AreEqual (r1.Top + 10, r2.Top);
+ Assert.AreEqual (r1.Width - 20, r2.Width);
+ Assert.AreEqual (r1.Height - 30, r2.Height);
+ }
+ }
+ }
+}
+
diff --git a/Testing/Tests/DatePickerTests.cs b/Testing/Tests/DatePickerTests.cs
new file mode 100644
index 00000000..d2affa79
--- /dev/null
+++ b/Testing/Tests/DatePickerTests.cs
@@ -0,0 +1,38 @@
+//
+// DatePickerTests.cs
+//
+// Author:
+// Lluis Sanchez <lluis@xamarin.com>
+//
+// Copyright (c) 2013 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 DatePickerTests: WidgetTests
+ {
+ public override Widget CreateWidget ()
+ {
+ return new DatePicker ();
+ }
+ }
+}
+
diff --git a/Testing/Tests/ExpanderTests.cs b/Testing/Tests/ExpanderTests.cs
new file mode 100644
index 00000000..4929de9e
--- /dev/null
+++ b/Testing/Tests/ExpanderTests.cs
@@ -0,0 +1,38 @@
+//
+// ExpanderTests.cs
+//
+// Author:
+// Lluis Sanchez <lluis@xamarin.com>
+//
+// Copyright (c) 2013 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 ExpanderTests: WidgetTests
+ {
+ public override Widget CreateWidget ()
+ {
+ return new Expander ();
+ }
+ }
+}
+
diff --git a/Testing/Tests/FrameTests.cs b/Testing/Tests/FrameTests.cs
index 9e1414c4..c8157336 100644
--- a/Testing/Tests/FrameTests.cs
+++ b/Testing/Tests/FrameTests.cs
@@ -28,12 +28,17 @@ using NUnit.Framework;
namespace Xwt
{
- public class FrameTests: WidgetTests
+ public class FrameTests: ContainerTests
{
public override Widget CreateWidget ()
{
return new Frame () { Label = "Hi there" };
}
+
+ protected override void AddChild (Widget parent, Widget child)
+ {
+ ((Frame)parent).Content = child;
+ }
}
}
diff --git a/Testing/Tests/HPanedTests.cs b/Testing/Tests/HPanedTests.cs
index ceeba9df..d8b29d1d 100644
--- a/Testing/Tests/HPanedTests.cs
+++ b/Testing/Tests/HPanedTests.cs
@@ -27,9 +27,9 @@ using System;
namespace Xwt
{
- public class HPanedTests: WidgetTests
+ public class HPanedTests: PanedTests
{
- public override Widget CreateWidget ()
+ public override Paned CreatePaned ()
{
return new HPaned ();
}
diff --git a/Testing/Tests/NotebookTests.cs b/Testing/Tests/NotebookTests.cs
index 2da4b255..e68ee987 100644
--- a/Testing/Tests/NotebookTests.cs
+++ b/Testing/Tests/NotebookTests.cs
@@ -27,12 +27,17 @@ using System;
namespace Xwt
{
- public class NotebookTests: WidgetTests
+ public class NotebookTests: ContainerTests
{
public override Widget CreateWidget ()
{
return new Notebook ();
}
+
+ protected override void AddChild (Widget parent, Widget child)
+ {
+ ((Notebook)parent).Add (child, "Test");
+ }
}
}
diff --git a/Testing/Tests/PanedTests.cs b/Testing/Tests/PanedTests.cs
new file mode 100644
index 00000000..d46ba57f
--- /dev/null
+++ b/Testing/Tests/PanedTests.cs
@@ -0,0 +1,45 @@
+//
+// PanedTests.cs
+//
+// Author:
+// Lluis Sanchez <lluis@xamarin.com>
+//
+// Copyright (c) 2013 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 abstract class PanedTests: ContainerTests
+ {
+ public override Widget CreateWidget ()
+ {
+ return CreatePaned ();
+ }
+
+ protected override void AddChild (Widget parent, Widget child)
+ {
+ ((Paned)parent).Panel1.Content = child;
+ }
+
+ public abstract Paned CreatePaned ();
+ }
+}
+
diff --git a/Testing/Tests/ScrollViewTests.cs b/Testing/Tests/ScrollViewTests.cs
index db418be9..028e333c 100644
--- a/Testing/Tests/ScrollViewTests.cs
+++ b/Testing/Tests/ScrollViewTests.cs
@@ -27,12 +27,17 @@ using System;
namespace Xwt
{
- public class ScrollViewTests: WidgetTests
+ public class ScrollViewTests: ContainerTests
{
public override Widget CreateWidget ()
{
return new ScrollView ();
}
+
+ protected override void AddChild (Widget parent, Widget child)
+ {
+ ((ScrollView)parent).Content = child;
+ }
}
}
diff --git a/Testing/Tests/ScrollbarTests.cs b/Testing/Tests/ScrollbarTests.cs
new file mode 100644
index 00000000..195c35a5
--- /dev/null
+++ b/Testing/Tests/ScrollbarTests.cs
@@ -0,0 +1,56 @@
+//
+// ScrollbarTests.cs
+//
+// Author:
+// Lluis Sanchez <lluis@xamarin.com>
+//
+// Copyright (c) 2013 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 abstract class ScrollbarTests: WidgetTests
+ {
+ public override Widget CreateWidget ()
+ {
+ return CreateScrollbar ();
+ }
+
+ public abstract Scrollbar CreateScrollbar ();
+ }
+
+ public class HScrollbarTests: ScrollbarTests
+ {
+ public override Scrollbar CreateScrollbar ()
+ {
+ return new HScrollbar ();
+ }
+ }
+
+ public class VScrollbarTests: ScrollbarTests
+ {
+ public override Scrollbar CreateScrollbar ()
+ {
+ return new VScrollbar ();
+ }
+ }
+}
+
diff --git a/Testing/Tests/SegmentedButtonTests.cs b/Testing/Tests/SegmentedButtonTests.cs
new file mode 100644
index 00000000..a08ec1c8
--- /dev/null
+++ b/Testing/Tests/SegmentedButtonTests.cs
@@ -0,0 +1,38 @@
+//
+// SegmentedButtonTests.cs
+//
+// Author:
+// Lluis Sanchez <lluis@xamarin.com>
+//
+// Copyright (c) 2013 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 SegmentedButtonTests: WidgetTests
+ {
+ public override Widget CreateWidget ()
+ {
+ return new SegmentedButton ();
+ }
+ }
+}
+
diff --git a/Testing/Tests/SliderTests.cs b/Testing/Tests/SliderTests.cs
new file mode 100644
index 00000000..85019117
--- /dev/null
+++ b/Testing/Tests/SliderTests.cs
@@ -0,0 +1,38 @@
+//
+// SliderTests.cs
+//
+// Author:
+// Lluis Sanchez <lluis@xamarin.com>
+//
+// Copyright (c) 2013 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 SliderTests: WidgetTests
+ {
+ public override Widget CreateWidget ()
+ {
+ return new Slider ();
+ }
+ }
+}
+
diff --git a/Testing/Tests/SpinnerTests.cs b/Testing/Tests/SpinnerTests.cs
new file mode 100644
index 00000000..94b89e3b
--- /dev/null
+++ b/Testing/Tests/SpinnerTests.cs
@@ -0,0 +1,38 @@
+//
+// SpinnerTests.cs
+//
+// Author:
+// Lluis Sanchez <lluis@xamarin.com>
+//
+// Copyright (c) 2013 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 SpinnerTests: WidgetTests
+ {
+ public override Widget CreateWidget ()
+ {
+ return new Spinner ();
+ }
+ }
+}
+
diff --git a/Testing/Tests/TableTests.cs b/Testing/Tests/TableTests.cs
index 4530581f..bb3235a7 100644
--- a/Testing/Tests/TableTests.cs
+++ b/Testing/Tests/TableTests.cs
@@ -27,7 +27,7 @@ using System;
namespace Xwt
{
- public class TableTests: WidgetTests
+ public class TableTests: ContainerTests
{
public override Widget CreateWidget ()
{
@@ -35,6 +35,12 @@ namespace Xwt
t.Add (new Label ("Hello Worlds"), 0, 0);
return t;
}
+
+ protected override void AddChild (Widget parent, Widget child)
+ {
+ ((Table)parent).Clear ();
+ ((Table)parent).Add (child, 0, 0, hexpand: true, vexpand: true);
+ }
}
}
diff --git a/Testing/Tests/ToggleButtonTests.cs b/Testing/Tests/ToggleButtonTests.cs
new file mode 100644
index 00000000..35bdbbff
--- /dev/null
+++ b/Testing/Tests/ToggleButtonTests.cs
@@ -0,0 +1,38 @@
+//
+// ToggleButtonTests.cs
+//
+// Author:
+// Lluis Sanchez <lluis@xamarin.com>
+//
+// Copyright (c) 2013 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 ToggleButtonTests: WidgetTests
+ {
+ public override Widget CreateWidget ()
+ {
+ return new ToggleButton ();
+ }
+ }
+}
+
diff --git a/Testing/Tests/TreeViewTests.cs b/Testing/Tests/TreeViewTests.cs
new file mode 100644
index 00000000..e2fec1ca
--- /dev/null
+++ b/Testing/Tests/TreeViewTests.cs
@@ -0,0 +1,38 @@
+//
+// TreeViewTests.cs
+//
+// Author:
+// Lluis Sanchez <lluis@xamarin.com>
+//
+// Copyright (c) 2013 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 TreeViewTests: WidgetTests
+ {
+ public override Widget CreateWidget ()
+ {
+ return new TreeView ();
+ }
+ }
+}
+
diff --git a/Testing/Tests/VPanedTests.cs b/Testing/Tests/VPanedTests.cs
index bb5e5664..270648ca 100644
--- a/Testing/Tests/VPanedTests.cs
+++ b/Testing/Tests/VPanedTests.cs
@@ -27,9 +27,9 @@ using System;
namespace Xwt
{
- public class VPanedTests: WidgetTests
+ public class VPanedTests: PanedTests
{
- public override Widget CreateWidget ()
+ public override Paned CreatePaned ()
{
return new VPaned ();
}
diff --git a/Testing/Tests/VScrollbar.cs b/Testing/Tests/VScrollbar.cs
new file mode 100644
index 00000000..6000a96e
--- /dev/null
+++ b/Testing/Tests/VScrollbar.cs
@@ -0,0 +1,37 @@
+//
+// VScrollbar.cs
+//
+// Author:
+// Lluis Sanchez <lluis@xamarin.com>
+//
+// Copyright (c) 2013 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 GtkTestRunner
+{
+ public class VScrollbar
+ {
+ public VScrollbar ()
+ {
+ }
+ }
+}
+
diff --git a/Testing/Tests/WindowTests.cs b/Testing/Tests/WindowTests.cs
index db28b373..e2d5c3fb 100644
--- a/Testing/Tests/WindowTests.cs
+++ b/Testing/Tests/WindowTests.cs
@@ -189,9 +189,16 @@ namespace Xwt
class SquareBox: Canvas
{
+ double size;
+
+ public SquareBox (double size = 10)
+ {
+ this.size = size;
+ }
+
protected override Size OnGetPreferredSize (SizeConstraint widthConstraint, SizeConstraint heightConstraint)
{
- return new Size (10, 10);
+ return new Size (size, size);
}
protected override void OnDraw (Context ctx, Rectangle dirtyRect)