public void TryParse_returns_false_for_invalid_input(string value) { var success = DocumentReference.TryParse(value, out var parsed); success.Should().BeFalse(); parsed.Should().BeNull(); }
public void TryParse_returns_true_for_self_references(string reference) { // ARRANGE // ACT var success = DocumentReference.TryParse(reference, out var parsed); // ASSERT success .Should().BeTrue(); parsed .Should().NotBeNull() .And.BeOfType <SelfDocumentReference>(); }
public void TryParse_returns_true_for_same_version_references(string reference, string name) { // ARRANGE var expectedName = new DocumentName(name); // ACT var success = DocumentReference.TryParse(reference, out var parsed); // ASSERT success .Should().BeTrue(); parsed .Should().NotBeNull() .And.BeOfType <SameVersionDocumentReference>() .Which.Name.Should().Be(expectedName); }
public void TryParse_returns_true_for_same_name_docs_references(string reference, string version) { // ARRANGE var expectedVersion = NuGetVersion.Parse(version); // ACT var success = DocumentReference.TryParse(reference, out var parsed); // ASSERT success .Should().BeTrue(); parsed .Should().NotBeNull() .And.BeOfType <SameNameDocumentReference>() .And.Match <SameNameDocumentReference>(r => r.Version == expectedVersion); }
public void Parse_returns_true_for_fully_qualified_docs_references(string reference, string name, string version) { // ARRANGE var expectedIdentity = new DocumentIdentity(new DocumentName(name), NuGetVersion.Parse(version)); // ACT var success = DocumentReference.TryParse(reference, out var parsed); // ASSERT success .Should().BeTrue(); parsed .Should().NotBeNull() .And.BeOfType <FullyQualifiedDocumentReference>() .And.Match <FullyQualifiedDocumentReference>(fqr => fqr.Identity == expectedIdentity); }