public void ForceLowerCaseText() { var sanitizer = new SlugCreator(); string before = "THIS-SHOULD-BE-FORCED-LOWERCASE"; string after = "this-should-be-forced-lowercase"; string result = sanitizer.Sanitize(before); result.ShouldBe(after); }
public ConstructionYard(IDeployerFactory factory, string rootDir) { _factory = factory; _rootDir = rootDir; _garbage = _factory.CreateGarbage(); _logger = _factory.CreateLogger(); _persist = _factory.CreatePersistence(); var smallIo = _factory.CreateSmallTextIo(_persist); var jsonPersist = new JsonPersistence(smallIo); var slugCreator = new SlugCreator(); _configService = new RealConfigurationService(_rootDir, jsonPersist, slugCreator); }
public void SeparatorTests2() { var config = new SlugConfiguration { Separator = "_" }; var sanitizer = new SlugCreator(config); string before = "separate this text with hyphens"; string after = "separate_this_text_with_hyphens"; string result = sanitizer.Sanitize(before); result.ShouldBe(after); }
public void IgnoreTextCase() { var config = new SlugConfiguration { TextCase = TextCase.Ignore }; var sanitizer = new SlugCreator(config); string before = "This-ShouLd-Be-Left-HOw-It-iS"; string after = "This-ShouLd-Be-Left-HOw-It-iS"; string result = sanitizer.Sanitize(before); result.ShouldBe(after); }
public void ForceUpperCaseText() { var config = new SlugConfiguration { TextCase = TextCase.UpperCase }; var sanitizer = new SlugCreator(config); string before = "this-should-be-forced-lowercase"; string after = "THIS-SHOULD-BE-FORCED-LOWERCASE"; string result = sanitizer.Sanitize(before); result.ShouldBe(after); }
public void BeforeEachTest() { _sut = new SlugCreator(); }