Exemple #1
0
 protected TestBuilder(TestPathType type, string identifier, string name, ITestParameter parameter, TestFlags flags = DefaultFlags)
 {
     PathType   = type;
     Identifier = identifier;
     Name       = name;
     Flags      = flags;
     Parameter  = parameter;
 }
Exemple #2
0
 protected TestHost(TestPathType type, string identifier, string name, string parameterType, TestFlags flags = TestFlags.None)
 {
     PathType      = type;
     Identifier    = identifier;
     Name          = name;
     ParameterType = parameterType;
     Flags         = flags;
 }
Exemple #3
0
        public static string GetTestDataDir(TestPathType pathType = TestPathType.MethodAndClassName)
        {
            var result = TestContext.CurrentContext.TestDirectory + "/../../TestData/";

            if (pathType.HasFlag(TestPathType.ClassName))
            {
                var className = TestContext.CurrentContext.Test.ClassName;
                result += className.Substring(className.LastIndexOf('.') + 1) + "/";
            }
            if (pathType.HasFlag(TestPathType.MethodName))
            {
                result += TestContext.CurrentContext.Test.MethodName + "/";
            }
            return(result);
        }
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the TestPath class.
 /// </summary>
 /// <param name="type">Whether to include or exclude the test path</param>
 /// <param name="path">Test path to set</param>
 public TestPath(TestPathType type, string path)
 {
     this.PathType = type;
     this.Value = path;
 }
Exemple #5
0
 static string WritePathType(TestPathType type)
 {
     return(Enum.GetName(typeof(TestPathType), type).ToLowerInvariant());
 }
Exemple #6
0
 public HeavyTestHost(TestPathType pathType, string identifier, string name, Type type, Type hostType, TestFlags flags)
     : base(pathType, identifier, name, TestPath.GetFriendlyName(hostType), flags)
 {
     Type = type;
 }
Exemple #7
0
 /// <summary>
 /// Initializes a new instance of the TestPath class.
 /// </summary>
 /// <param name="type">Whether to include or exclude the test path</param>
 /// <param name="path">Test path to set</param>
 public TestPath(TestPathType type, string path)
 {
     this.PathType = type;
     this.Value    = path;
 }