public void Should_return_null() { var sut = new StoreLinksInMemory(); var result = sut.WithId("unknown-link-id"); result.Should().BeNull(); }
public void Should_return_the_link_with_the_specified_id() { var sut = new StoreLinksInMemory(); var result = sut.WithId("known-link-id"); result?.Id.Should().Be("known-link-id"); }
public void Should_return_the_href_of_the_specified_link() { var sut = new StoreLinksInMemory(); var result = sut.WithId("known-link-id"); result?.Href.Should().Be("http://example.com"); }
public void Should_save_a_link_with_the_specified_id() { var sut = new StoreLinksInMemory(); sut.WithIdAndUrl("id", new Uri("http://example.com")); sut.WithId("id").Should().NotBeNull(); }
public void Should_save_a_link_with_the_specified_url() { var sut = new StoreLinksInMemory(); var url = new Uri("http://example.com"); sut.WithIdAndUrl("id", url); sut.WithId("id")?.Href.Should().Be(url); }
public void Should_replace_the_url_for_the_link_with_specified_id() { var sut = new StoreLinksInMemory(); sut.WithIdAndUrl("id", new Uri("http://existing.com")); var newUrl = new Uri("http://example.com"); sut.WithIdAndUrl("id", newUrl); sut.WithId("id")?.Href.Should().Be(newUrl); }