public void TryParse_WhenStringDoesNotRepresentValidIsbnCode_ReturnsFalse(string s) { // Arrange // Act IsbnCode isbn; bool result = IsbnCode.TryParse(s, out isbn); // Assert Assert.That(result, Is.False); Assert.That(isbn, Is.Null); }
[TestCase("97910-19-01092-3")] // fictional code public void TryParse_WhenStringRepresentsValidIsbnCode_ReturnsTrue(string s) { // Arrange // Act IsbnCode isbn; bool result = IsbnCode.TryParse(s, out isbn); // Assert Assert.That(result, Is.True); Assert.That(isbn, Is.EqualTo(IsbnCode.Parse(s))); }