public void AdditionalToStringTest(IBook book, string expected) { // Arrange // Act string result = book.AdditionalToString(); // Assert Assert.AreEqual(expected, result); }
/// <summary> /// Converts a book to its another string representation /// </summary> /// <returns>Another string that represents book</returns> public string AdditionalToString() { string result = _bookParameter + _book.AdditionalToString(); if (result.Length >= 2 && result.Substring(result.Length - 2) == ", ") { result = result.Substring(0, result.Length - 2); } return(result); }