Possible types for test items, as used in TestItem. TestItemType is implemented using the Descriptor pattern.
Наследование: Descriptor
Пример #1
0
 public virtual IEnumerable<TestItem> FindItems(TestItemType type, object subject, TestAction action)
 {
     return _items
        .Where(item => item.Type == type)
        .Where(item => item.Subject == subject)
        .Where(item => item.Action == action);
 }
Пример #2
0
        public virtual bool IsNotPresent(TestItemType type, TestAction action)
        {
            bool present = IsActionPresent(type, action);

            var result = String.Format("[{0}] {1}", type, action);

            Assert.IsFalse(present, result);

            return !present;
        }
Пример #3
0
        /// <summary>
        /// Running a test, by checking if the requested item is in the registry.
        /// </summary>
        /// <param name="type">Type of test item</param>
        /// <param name="subject">Subject</param>
        /// <param name="action">Action to be passed</param>
        /// <returns>True if item is in registry, false if not.</returns>
        public virtual bool IsPresent(TestItemType type, object subject, TestAction action)
        {
            var present = _items
                .Where(item => item.Type == type)
                .Where(item => item.Subject == subject)
                .Where(item => item.Action == action)
                .Count() > 0;

            var result = String.Format("[{0}] {1} : {2}", type, subject, action);

            Assert.IsTrue(present, result);

            return present;
        }
Пример #4
0
 /// <summary>
 /// Running a test, by checking if the requested item is in the registry.
 /// </summary>
 /// <param name="type">Type of test item</param>
 /// <param name="subject">Message to be passed</param>
 /// <returns>True if item is in registry, false if not.</returns>
 public static bool IsPresent(TestItemType type, object subject)
 {
     return Provider.IsPresent(type, subject);
 }
Пример #5
0
 /// <summary>
 /// Running a test, by checking if the requested item is in the registry.
 /// </summary>
 /// <param name="type">Type of test item</param>
 /// <param name="action">Message to be passed</param>
 /// <returns>True if item is in registry, false if not.</returns>
 public static bool IsPresent(TestItemType type, TestAction action)
 {
     return Provider.IsPresent(type, action);
 }
Пример #6
0
 /// <summary>
 /// Running a test, by checking if the requested item is not in the registry.
 /// </summary>
 /// <param name="type">Type of test item</param>
 /// <param name="subject">Subject</param>
 /// <param name="action">Action to be passed</param>
 /// <returns>False if item is in registry, true if not.</returns>
 public static bool IsNotPresent(TestItemType type, object subject, TestAction action)
 {
     return Provider.IsNotPresent(type, subject, action);
 }
Пример #7
0
 public static IEnumerable<TestItem> FindItems(TestItemType task, object subject, TestAction action)
 {
     return Provider.FindItems(task, subject, action);
 }
Пример #8
0
 /// <summary>
 /// Register a test item.
 /// </summary>
 /// <param name="type">Type of test item</param>
 /// <param name="action">Message to be passed</param>
 public static void Register(TestItemType type, TestAction action, params object[] p)
 {
     Provider.Register(type, action, p);
 }
Пример #9
0
 /// <summary>
 /// Register a test item.
 /// </summary>
 /// <param name="type">Type of test item</param>
 /// <param name="subject">Subject</param>
 public static void Register(TestItemType type, object subject, params object[] p)
 {
     Provider.Register(type, subject, p);
 }
Пример #10
0
 public static IEnumerable<TestItem> FindItems(TestItemType type, TestAction action)
 {
     return Provider.FindItems(type, action);
 }
Пример #11
0
 private bool IsActionPresent(TestItemType type, TestAction action)
 {
     return _items
                .Where(item => item.Type == type)
                .Where(item => item.Action == action)
                .Count() > 0;
 }
Пример #12
0
 /// <summary>
 /// Register a test item.
 /// </summary>
 /// <param name="type">Type of test item</param>
 /// <param name="action">Action to be passed</param>
 /// <param name="p">Parameters passed from task</param>
 public virtual void Register(TestItemType type, TestAction action, params object[] p)
 {
     Register(type, new object(), action, p);
 }
Пример #13
0
 /// <summary>
 /// Register a test item.
 /// </summary>
 /// <param name="type">Type of test item</param>
 /// <param name="subject">Subject</param>
 /// <param name="p">Parameters passed from task</param>
 public virtual void Register(TestItemType type, object subject, params object[] p)
 {
     Register(type, subject, new TestAction(string.Empty), p);
 }
Пример #14
0
 /// <summary>
 /// Register a test item.
 /// </summary>
 /// <param name="type">Type of test item</param>
 /// <param name="subject">Subject</param>
 /// <param name="action">Action to be passed</param>
 /// <param name="p">Parameters passed from task</param>
 public virtual void Register(TestItemType type, object subject, TestAction action, params object[] p)
 {
     _items.Add(new TestItem {Type = type, Subject = subject, Action = action, Parameters = p});
 }