Possible types for test items, as used in TestItem. TestItemType is implemented using the Descriptor pattern.
상속: Descriptor
예제 #1
0
파일: TestProvider.cs 프로젝트: NLADP/ADF
 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
파일: TestProvider.cs 프로젝트: NLADP/ADF
        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
파일: TestProvider.cs 프로젝트: NLADP/ADF
        /// <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
파일: TestManager.cs 프로젝트: NLADP/ADF
 public static IEnumerable<TestItem> FindItems(TestItemType type, TestAction action)
 {
     return Provider.FindItems(type, action);
 }
예제 #11
0
파일: TestProvider.cs 프로젝트: NLADP/ADF
 private bool IsActionPresent(TestItemType type, TestAction action)
 {
     return _items
                .Where(item => item.Type == type)
                .Where(item => item.Action == action)
                .Count() > 0;
 }
예제 #12
0
파일: TestProvider.cs 프로젝트: NLADP/ADF
 /// <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
파일: TestProvider.cs 프로젝트: NLADP/ADF
 /// <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
파일: TestProvider.cs 프로젝트: NLADP/ADF
 /// <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});
 }