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();
        }
Esempio n. 2
0
 public NamedTheoryAttribute(NameIt nameIt, SplitBy splitBy, JoinWith joinWith, [CallerMemberName] string callerName = null, [CallerFilePath] string sourceFilePath = null)
     : base(nameIt, splitBy, joinWith, callerName, sourceFilePath)
 {
 }
Esempio n. 3
0
 public NamedTheoryAttribute(SplitBy splitBy, JoinWith joinWith, [CallerMemberName] string callerName = null, [CallerFilePath] string sourceFilePath = null)
     : this(NameIt.MethodName, splitBy, joinWith, callerName, sourceFilePath)
 {
 }
Esempio n. 4
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);
        }