public void AnnounceEndpoints_returns_empty_disposable_if_not_enabled([Frozen] AnnouncementServiceOptions options, AnnouncementService sut, IReadOnlyList <ServiceEndpoint> endpoints) { options.IsAnnouncementEnabled = false; var result = sut.AnnounceEndpoints(endpoints); Assert.That(result, Is.SameAs(Disposable.Empty)); result.Dispose(); }
public void AnnounceEndpoints_does_stuff([Frozen] AnnouncementServiceOptions options, AnnouncementService sut, ServiceEndpoint testEndpoint, Uri endpointUri) { testEndpoint.Address = new EndpointAddress(endpointUri); options.IsAnnouncementEnabled = true; testEndpoint.Behaviors.Add(new AnnounceableBehavior()); var disposable = sut.AnnounceEndpoints(new[] { testEndpoint }); disposable.Dispose(); }