public void ReusesClients() { var clients = new AspNetCoreClients(); var first = clients.Client( new TimeSpan(0, 1, 0) ); first.BaseAddress = new Uri("http://localhost/this/is/a/test"); var second = clients.Client( new TimeSpan(0, 1, 0) // same timeout should return same client ); Assert.Equal( first.BaseAddress, second.BaseAddress ); }
public void ReturnsDifferentClients() { var clients = new AspNetCoreClients(); var first = clients.Client( new TimeSpan(0, 1, 1) ); first.BaseAddress = new Uri("http://localhost/this/is/a/test"); var second = clients.Client( new TimeSpan(0, 2, 1) // different timeout should return new client ); Assert.NotEqual( first.BaseAddress, second.BaseAddress ); }