Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
TestElement.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under Apache 2.0 License. See LICENSE.md for details.
3 //
4 // TestElement.cs: MonoTouch.Dialog element for ITest, i.e. TestSuite and TestCase
5 //
6 // Authors:
7 // Sebastien Pouliot <sebastien@xamarin.com>
8 //
9 // Copyright 2011-2012 Xamarin Inc.
10 //
11 // Licensed under the Apache License, Version 2.0 (the "License");
12 // you may not use this file except in compliance with the License.
13 // You may obtain a copy of the License at
14 //
15 // http://www.apache.org/licenses/LICENSE-2.0
16 //
17 // Unless required by applicable law or agreed to in writing, software
18 // distributed under the License is distributed on an "AS IS" BASIS,
19 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 // See the License for the specific language governing permissions and
21 // limitations under the License.
22 //
23 
24 using System;
25 
26 #if XAMCORE_2_0
27 using UIKit;
28 #else
29 using MonoTouch.UIKit;
30 #endif
31 
32 using MonoTouch.Dialog;
33 
34 using NUnit.Framework.Internal;
35 using NUnit.Framework.Api;
36 
37 namespace SiliconStudio.Paradox.UnitTesting.UI {
38 
40 
41  static internal UIColor DarkGreen = UIColor.FromRGB (0x00, 0x77, 0x00);
42 
43  private TestResult result;
44 
45  public TestElement (ITest test, TouchRunner runner)
46  : base ("?", "?", UITableViewCellStyle.Subtitle)
47  {
48  if (test == null)
49  throw new ArgumentNullException ("test");
50  if (runner == null)
51  throw new ArgumentNullException ("runner");
52 
53  Test = test;
54  Runner = runner;
55  }
56 
57  protected TouchRunner Runner { get; private set; }
58 
59  public TestResult Result {
60  get { return result ?? new TestCaseResult (Test as TestMethod); }
61  set { result = value; }
62  }
63 
64  protected ITest Test { get; private set; }
65 
66  public void Update (TestResult result)
67  {
68  Result = result;
69 
70  Update ();
71  }
72 
73  abstract public void Update ();
74  }
75 }
TestElement(ITest test, TouchRunner runner)
Definition: TestElement.cs:45