public void RemovesClientFromCache() { var program = new Program(); var enterpriseProbe = Substitute.For <IEnterpriseProbeTask>(); var wikiProbe = Substitute.For <IWikiProbe>(); var factory = new SimpleApiClientFactory( program, new Lazy <IEnterpriseProbeTask>(() => enterpriseProbe), new Lazy <IWikiProbe>(() => wikiProbe)); var client = factory.Create("https://github.com/github/visualstudio"); factory.ClearFromCache(client); Assert.NotSame(client, factory.Create("https://github.com/github/visualstudio")); }
public async Task RemovesClientFromCache() { const string url = "https://github.com/github/RemovesClientFromCache"; var program = new Program(); var enterpriseProbe = Substitute.For <IEnterpriseProbeTask>(); var wikiProbe = Substitute.For <IWikiProbe>(); var factory = new SimpleApiClientFactory( program, new Lazy <IEnterpriseProbeTask>(() => enterpriseProbe), new Lazy <IWikiProbe>(() => wikiProbe)); var client = await factory.Create(url); factory.ClearFromCache(client); Assert.NotSame(client, factory.Create(url)); }