public NamedFactAttribute(NameIt nameIt, SplitBy splitBy, JoinWith joinWith, [CallerMemberName] string methodName = null, [CallerFilePath] string absoluteFilePath = null)
        {
            NameIt   = nameIt;
            Splitter = splitBy;
            Joiner   = joinWith;

            AbsolutePath = absoluteFilePath;
            AbsolutePathWithoutExtension = GetCallerFilePathWithoutFileExtension();
            NameSpace = GetNameSpace();
            FileName  = Path.GetFileName(absoluteFilePath);
            FileNameWithoutExtension = Path.GetFileNameWithoutExtension(absoluteFilePath);
            MethodName = methodName;

            SetDisplayName();
        }
Exemplo n.º 2
0
 public static string[] SplitByPipe(string input) => SplitBy(input, '|', ('(', ')'), ('[', ']'), ('{', '}'), ('"', '"')).ToArray();
Exemplo n.º 3
0
 public static string[] SplitByTwoPoints(string input) => SplitBy(input, ':', ('(', ')'), ('[', ']'), ('{', '}'), ('"', '"')).ToArray();
Exemplo n.º 4
0
 public NamedTheoryAttribute(NameIt nameIt, SplitBy splitBy, JoinWith joinWith, [CallerMemberName] string callerName = null, [CallerFilePath] string sourceFilePath = null)
     : base(nameIt, splitBy, joinWith, callerName, sourceFilePath)
 {
 }
Exemplo n.º 5
0
 public NamedTheoryAttribute(SplitBy splitBy, JoinWith joinWith, [CallerMemberName] string callerName = null, [CallerFilePath] string sourceFilePath = null)
     : this(NameIt.MethodName, splitBy, joinWith, callerName, sourceFilePath)
 {
 }
Exemplo n.º 6
0
 public NamedTheoryAttribute(SplitBy splitBy, [CallerMemberName] string callerName = null, [CallerFilePath] string sourceFilePath = null)
     : base(NameIt.MethodName, splitBy, JoinWith.SingleSpace, callerName, sourceFilePath)
 {
 }
Exemplo n.º 7
0
        public void DisplayNameShouldHaveCorrectValueForTestCases(string testCase, string expected, SplitBy splitter, JoinWith joiner = JoinWith.SingleSpace)
        {
            var attribute = new NamedFactAttribute(splitter, joiner, testCase);

            attribute.SetDisplayName();

            var result = attribute.DisplayName;

            result.Should().Be(expected);
        }