public void AddRangeAsyncInvalid() { IWatchListProvider provider = GetProvider(); Assert.Throws <ArgumentNullException> (() => provider.AddRangeAsync(null, Enumerable.Empty <Person>())); Assert.Throws <ArgumentNullException> (() => provider.AddRangeAsync(personA, null)); }
public void GetWatchers() { IWatchListProvider provider = GetProvider(); provider.AddRangeAsync(personA, new[] { personB, personC }).Wait(); provider.AddRangeAsync(personB, new[] { personA, personC }).Wait(); IEnumerable <Person> watchers = provider.GetWatchersAsync(personC.Identity).Result; CollectionAssert.Contains(watchers, personA); CollectionAssert.Contains(watchers, personB); }
public void AddRangeAsync() { IWatchListProvider provider = GetProvider(); provider.AddRangeAsync(personA, new[] { personB, personC }).Wait(); IEnumerable <Person> buddies = provider.GetWatchedAsync(personA.Identity).Result; CollectionAssert.Contains(buddies, personB); CollectionAssert.Contains(buddies, personC); }