public void ConnectionInformationForProtocolWithNullVersion() { var info = new[] { new ProtocolInformation( new Version(3, 0, 0, 0), new Uri("http://localhost/invalid/v3")), new ProtocolInformation( new Version(1, 0, 0, 0), new Uri("http://localhost/invalid/v1")), new ProtocolInformation( new Version(2, 0, 0, 0), new Uri("http://localhost/invalid/v2")), }; var endpoint = new InformationEndpoint(info); Assert.IsNull(endpoint.ConnectionInformationForProtocol(null)); }
public void ConnectionInformationForProtocol() { var info = new[] { new ProtocolInformation( new Version(3, 0, 0, 0), new Uri("http://localhost/invalid/v3")), new ProtocolInformation( new Version(1, 0, 0, 0), new Uri("http://localhost/invalid/v1")), new ProtocolInformation( new Version(2, 0, 0, 0), new Uri("http://localhost/invalid/v2")), }; var endpoint = new InformationEndpoint(info); var output = endpoint.ConnectionInformationForProtocol(new Version(2, 0, 0, 0)); Assert.IsNotNull(output); Assert.AreSame(info[2].Version, output.ProtocolVersion); Assert.AreSame(info[2].MessageAddress, output.Address); }
public void ProtocolVersions() { var info = new[] { new ProtocolInformation( new Version(3, 0, 0, 0), new Uri("http://localhost/invalid/v3")), new ProtocolInformation( new Version(1, 0, 0, 0), new Uri("http://localhost/invalid/v1")), new ProtocolInformation( new Version(2, 0, 0, 0), new Uri("http://localhost/invalid/v2")), }; var endpoint = new InformationEndpoint(info); var versions = endpoint.ProtocolVersions(); Assert.That( versions, Is.EquivalentTo( info.Select(i => i.Version) .OrderBy(v => v))); }
public void Version() { var endpoint = new InformationEndpoint(new ProtocolInformation[0]); Assert.AreEqual(new Version(1, 0, 0, 0), endpoint.Version()); }