仿真平台内核初版 -tlib库 包含<sparc arm riscv powerPC>
This commit is contained in:
38
lib/termsharp/xwt/Test/ButtonTests.cs
Normal file
38
lib/termsharp/xwt/Test/ButtonTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
lib/termsharp/xwt/Test/CanvasTests.cs
Normal file
38
lib/termsharp/xwt/Test/CanvasTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
lib/termsharp/xwt/Test/CheckBoxTests.cs
Normal file
38
lib/termsharp/xwt/Test/CheckBoxTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
40
lib/termsharp/xwt/Test/ComboBoxEntryTests.cs
Normal file
40
lib/termsharp/xwt/Test/ComboBoxEntryTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
39
lib/termsharp/xwt/Test/ComboBoxTests.cs
Normal file
39
lib/termsharp/xwt/Test/ComboBoxTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
39
lib/termsharp/xwt/Test/FrameTests.cs
Normal file
39
lib/termsharp/xwt/Test/FrameTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
lib/termsharp/xwt/Test/HBoxTests.cs
Normal file
38
lib/termsharp/xwt/Test/HBoxTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
lib/termsharp/xwt/Test/HPanedTests.cs
Normal file
38
lib/termsharp/xwt/Test/HPanedTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
lib/termsharp/xwt/Test/HSeparatorTests.cs
Normal file
38
lib/termsharp/xwt/Test/HSeparatorTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
lib/termsharp/xwt/Test/ImageViewTests.cs
Normal file
38
lib/termsharp/xwt/Test/ImageViewTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
lib/termsharp/xwt/Test/LabelTests.cs
Normal file
38
lib/termsharp/xwt/Test/LabelTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
lib/termsharp/xwt/Test/ListBoxTests.cs
Normal file
38
lib/termsharp/xwt/Test/ListBoxTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
lib/termsharp/xwt/Test/ListViewTests.cs
Normal file
38
lib/termsharp/xwt/Test/ListViewTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
lib/termsharp/xwt/Test/NotebookTests.cs
Normal file
38
lib/termsharp/xwt/Test/NotebookTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
lib/termsharp/xwt/Test/ProgressBarTests.cs
Normal file
38
lib/termsharp/xwt/Test/ProgressBarTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
lib/termsharp/xwt/Test/ScrollViewTests.cs
Normal file
38
lib/termsharp/xwt/Test/ScrollViewTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
46
lib/termsharp/xwt/Test/Setup.cs
Normal file
46
lib/termsharp/xwt/Test/Setup.cs
Normal file
@@ -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 ()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
lib/termsharp/xwt/Test/SpinButtonTests.cs
Normal file
38
lib/termsharp/xwt/Test/SpinButtonTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
lib/termsharp/xwt/Test/TableTests.cs
Normal file
38
lib/termsharp/xwt/Test/TableTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
74
lib/termsharp/xwt/Test/Test.csproj
Normal file
74
lib/termsharp/xwt/Test/Test.csproj
Normal file
@@ -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>
|
||||
38
lib/termsharp/xwt/Test/TextEntryTests.cs
Normal file
38
lib/termsharp/xwt/Test/TextEntryTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
lib/termsharp/xwt/Test/VBoxTests.cs
Normal file
38
lib/termsharp/xwt/Test/VBoxTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
lib/termsharp/xwt/Test/VPanedTests.cs
Normal file
38
lib/termsharp/xwt/Test/VPanedTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
lib/termsharp/xwt/Test/VSeparatorTests.cs
Normal file
38
lib/termsharp/xwt/Test/VSeparatorTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
239
lib/termsharp/xwt/Test/WidgetTests.cs
Normal file
239
lib/termsharp/xwt/Test/WidgetTests.cs
Normal file
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user