Example #1
0
        /// <summary>
        /// Enumerates the MbUnitCpp tests and fixtures found in the repository.
        /// </summary>
        /// <returns>An enumerator of information strutures about the tests/fixtures found in the repository.</returns>
        /// <exception cref="InvalidOperationException">Thrown if the repository is not valid.</exception>
        public IEnumerable <TestInfoData> GetTests()
        {
            if (!IsValid)
            {
                throw new InvalidOperationException("The target MbUnitCpp test library is not valid.");
            }

            var      getHeadTest = (GetHeadTestDelegate)Marshal.GetDelegateForFunctionPointer(procGetHeadTest, typeof(GetHeadTestDelegate));
            var      getNextTest = (GetNextTestDelegate)Marshal.GetDelegateForFunctionPointer(procGetNextTest, typeof(GetNextTestDelegate));
            Position position;

            getHeadTest(out position);
            var data = new NativeTestInfoData();

            while (getNextTest(ref position, ref data) > 0)
            {
                yield return(new TestInfoData(data));
            }
        }
Example #2
0
 public TestInfoData(NativeTestInfoData native)
 {
     this.native = native;
 }
        /// <summary>
        /// Enumerates the MbUnitCpp tests and fixtures found in the repository.
        /// </summary>
        /// <returns>An enumerator of information strutures about the tests/fixtures found in the repository.</returns>
        /// <exception cref="InvalidOperationException">Thrown if the repository is not valid.</exception>
        public IEnumerable<TestInfoData> GetTests()
        {
            if (!IsValid)
                throw new InvalidOperationException("The target MbUnitCpp test library is not valid.");

            var getHeadTest = (GetHeadTestDelegate)Marshal.GetDelegateForFunctionPointer(procGetHeadTest, typeof(GetHeadTestDelegate));
            var getNextTest = (GetNextTestDelegate)Marshal.GetDelegateForFunctionPointer(procGetNextTest, typeof(GetNextTestDelegate));
            Position position;
            getHeadTest(out position);
            var data = new NativeTestInfoData();

            while (getNextTest(ref position, ref data) > 0)
            {
                yield return new TestInfoData(data);
            }
        }
Example #4
0
 public TestInfoData(NativeTestInfoData native)
 {
     this.native = native;
 }