public void TryRemoveWithApprovedEndpoint() { var storage = new EndpointInformationStorage(); var endpoint = new EndpointId("a"); var connection = new EndpointInformation( new EndpointId("a"), new DiscoveryInformation(new Uri("http://localhost/discovery/invalid")), new ProtocolInformation( new Version(), new Uri("http://localhost/protocol/invalid"))); Assert.IsTrue(storage.TryAdd(endpoint, connection)); Assert.IsFalse(storage.CanCommunicateWithEndpoint(endpoint)); Assert.IsTrue(storage.HasBeenContacted(endpoint)); Assert.IsFalse(storage.IsWaitingForApproval(endpoint)); var description = new ProtocolDescription(new List <CommunicationSubject>()); Assert.IsTrue(storage.TryStartApproval(endpoint, description)); Assert.IsTrue(storage.TryCompleteApproval(endpoint)); Assert.IsTrue(storage.CanCommunicateWithEndpoint(endpoint)); Assert.IsFalse(storage.IsWaitingForApproval(endpoint)); Assert.IsTrue(storage.TryRemoveEndpoint(endpoint)); Assert.IsFalse(storage.CanCommunicateWithEndpoint(endpoint)); Assert.IsFalse(storage.IsWaitingForApproval(endpoint)); Assert.IsFalse(storage.HasBeenContacted(endpoint)); }
public void TryRemoveWithUnknownEndpoint() { var storage = new EndpointInformationStorage(); var endpoint = new EndpointId("a"); Assert.IsFalse(storage.TryRemoveEndpoint(endpoint)); }
public void TryRemoveWithNullEndpoint() { var storage = new EndpointInformationStorage(); Assert.IsFalse(storage.TryRemoveEndpoint(null)); }