Concordion.Internal.ClassNameBasedSpecificationLocator.LocateSpecification C# (CSharp) Method

LocateSpecification() public method

public LocateSpecification ( object fixture ) : Resource
fixture object
return Concordion.Api.Resource
        public Resource LocateSpecification(object fixture)
        {
            var fixtureName = fixture.GetType().ToString();
            fixtureName = fixtureName.Replace(".", "\\");

            //Add Test und Fixture -> Case Sensitive
            fixtureName = Regex.Replace(fixtureName, "(Fixture|Test)$", "");
            //Suffix from Concordion.Specification.config
            var path = fixtureName + "." + m_SpecificationSuffix;
            return new Resource(path, fixture.GetType().Assembly.GetName().Name);
        }

Usage Example

 public void ShouldNotRemoreWordTestInBetween()
 {
     var specificationLocator = new ClassNameBasedSpecificationLocator();
     var resource = specificationLocator.LocateSpecification(new DummyContainingTestInNameTest());
     var path = resource.Path.Replace(Path.DirectorySeparatorChar, '/');
     Assert.AreEqual("Concordion/Test/Internal/DummyContainingTestInName.html", path, "path from SpecificiationLocator removed 'Test' in the middle");
 }
All Usage Examples Of Concordion.Internal.ClassNameBasedSpecificationLocator::LocateSpecification