Example #1
0
 public static IGraphRoute<TestCell> GetRoute(IFlatOrthogonalGraph<TestCell> graph, Func<TestCell, TestCell, double> estimator, TestCell source, TestCell target)
 {
     return graph.CalculateRoute(source, target,
         (a, b) => estimator(a, b),
         (a, b) => 1,
         (a) => a.Blocked
         );
 }
Example #2
0
 private static bool CellMatchesTestValue(Cell cell, TestCell testCell)
 {
     return(cell.Identifier.Row == testCell.Row &&
            cell.Identifier.CellDescriptor != null &&
            cell.Identifier.CellDescriptor.Column == testCell.Column &&
            cell.Identifier.CellDescriptor.Qualifier == testCell.Qualifier &&
            cell.Identifier.Timestamp == testCell.Timestamp &&
            cell.Value == testCell.Value);
 }
Example #3
0
		public void Selected ()
		{
			var cell = new TestCell ();

			bool tapped = false;
			cell.Tapped += (sender, args) => tapped = true;

			cell.OnTapped();
			Assert.IsTrue (tapped);
		}
Example #4
0
        public void Selected()
        {
            var cell = new TestCell();

            bool tapped = false;

            cell.Tapped += (sender, args) => tapped = true;

            cell.OnTapped();
            Assert.IsTrue(tapped);
        }
Example #5
0
		public void DisappearingEvent ()
		{
			var cell = new TestCell ();

			bool emitted = false;
			cell.Disappearing += (sender, args) => emitted = true;

			((ICellController)cell).SendDisappearing ();
			Assert.True (emitted);
			Assert.False (cell.OnAppearingSent);
			Assert.True (cell.OnDisappearingSent);
		}
Example #6
0
        public void DisappearingEvent()
        {
            var cell = new TestCell();

            bool emitted = false;

            cell.Disappearing += (sender, args) => emitted = true;

            cell.SendDisappearing();
            Assert.True(emitted);
            Assert.False(cell.OnAppearingSent);
            Assert.True(cell.OnDisappearingSent);
        }
Example #7
0
    void InitEmojiFaceCell(EmojiText.EmojiType emojiType, Transform gobParent)
    {
        string prefabPath     = TestCell.GetPrefabPath();
        var    emojiEntryList = EmojiTableManager.Instance.GetAllEmojiEntry();

        for (int i = 1; i < emojiEntryList.Count; i++)
        {
            if (emojiEntryList [i].Type == emojiType)
            {
                var        prefab = Resources.Load <GameObject> (prefabPath);
                GameObject gob    = Instantiate(prefab);
                var        cell   = gob.GetComponent <TestCell>();
                cell.transform.SetParent(gobParent, false);
                cell.Initialize(emojiEntryList[i], OnEmojiClick);
            }
        }
    }
Example #8
0
        private void ReadTests()
        {
            foreach (Type t in asm.GetTypes())
            {
                if (t.IsClass)
                {
                    if (!t.IsDefined(typeof(TestCaseAttribute), false)) continue;
                    object[] attrs = t.GetCustomAttributes(typeof(TestCaseAttribute), false);
                    TestCaseAttribute attr = (TestCaseAttribute)attrs[0];
                    TestCell cell = new TestCell() { TestType = t, TestName = attr.Name };

                    foreach (MethodInfo mi in t.GetMethods())
                    {
                        if (!mi.IsDefined(typeof(TestCaseMethodAttribute), false)) continue;
                        object[] mattrs = mi.GetCustomAttributes(typeof(TestCaseMethodAttribute), false);
                        TestCaseMethodAttribute mattr = (TestCaseMethodAttribute)mattrs[0];
                        ParameterInfo[] pi = mi.GetParameters();
                        MetaMethod mm = new MetaMethod() { Name = mi.Name, Description = mattr.Description, AcceptsSink = false };
                        if (pi.Length == 1 && pi[0].ParameterType == typeof(IResultSink))
                            mm.AcceptsSink = true;
                        cell.TestMethods.Add(mm.Name, mm);
                    }
                    if (cell.TestMethods.Count > 0)
                        testCells.Add(attr.Name, cell);
                }
            }
        }
 public void SetUp()
 {
     _cell            = new TestCell();
     _cellInformation = DataGridCellInformation.FromCell(_cell);
 }
 public void SetUp()
 {
     _cell = new TestCell();
     _cellInformation = DataGridCellInformation.FromCell(_cell);
 }