public void GetFormattedIndividualAuthors_ValidAuthorInAuthorField_ProcessesCorrectly() { // Arrange var input = "Anthony N. Author"; // Act var result = new OutputAuthorFormat().GetFormattedIndividualAuthors(input).ToList(); // Assert Assert.AreEqual(1, result.Count); Assert.AreEqual("Anthony N. Author", result[0]); }
public string GetFormattedIndividualAuthors_IncludeSuffix_FormatsCorrectly(string input, bool includeSuffix) { // Arrange var format = new OutputAuthorFormat { IncludeSuffix = includeSuffix }; // Act var result = format.GetFormattedIndividualAuthors(input).ToList(); // Assert Assert.AreEqual(1, result.Count); return(result[0]); }
public string GetFormattedIndividualAuthors_LastNameFirst_FormatsCorrectly(string input, bool lastNameFirst) { // Arrange var format = new OutputAuthorFormat { LastNameFirst = lastNameFirst }; // Act var result = format.GetFormattedIndividualAuthors(input).ToList(); // Assert Assert.AreEqual(1, result.Count); return(result[0]); }
public void FormatAuthorField_AuthorField_ReturnsFormattedString() { // Arrange var input = "A. N. Author and Author, Anne Other and A. Final Author"; var format = new OutputAuthorFormat { IncludeMiddleNames = true, Delimiter = ',', FinalDelimiter = "and", NumberOfNamedAuthors = 3 }; // Act var result = format.FormatAuthorField(input); // Assert Assert.AreEqual("A. N. Author, Anne Other Author and A. Final Author", result); }
public string GetFormattedIndividualAuthors_AbreviateCharacters_AbbreviatesCorrectly(int?abbreviateChars) { // Arrange var input = "Anthony Author"; var format = new OutputAuthorFormat { AbbreviateFirstNameCharacters = abbreviateChars }; // Act var result = format.GetFormattedIndividualAuthors(input).ToList(); // Assert Assert.AreEqual(1, result.Count); return(result[0]); }